line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Carp::DebugScreen::DefaultView;
|
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
4944
|
use strict;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
96
|
|
4
|
2
|
|
|
2
|
|
14
|
use warnings;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
2685
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.15';
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub as_html {
|
9
|
12
|
|
|
12
|
1
|
163
|
my ($pkg, %options) = @_;
|
10
|
|
|
|
|
|
|
|
11
|
12
|
|
|
|
|
29
|
delete $options{debug_template};
|
12
|
12
|
|
|
|
|
21
|
delete $options{error_template};
|
13
|
|
|
|
|
|
|
|
14
|
12
|
100
|
|
|
|
119
|
$options{debug} ? $pkg->_debug(%options) : $pkg->_error(%options);
|
15
|
|
|
|
|
|
|
}
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _escape {
|
18
|
934
|
|
|
934
|
|
1138
|
my $str = shift;
|
19
|
|
|
|
|
|
|
|
20
|
934
|
|
|
|
|
1217
|
$str =~ s/&/&/g;
|
21
|
934
|
|
|
|
|
1150
|
$str =~ s/>/>/g;
|
22
|
934
|
|
|
|
|
997
|
$str =~ s/</g;
|
23
|
934
|
|
|
|
|
1029
|
$str =~ s/"/"/g;
|
24
|
|
|
|
|
|
|
|
25
|
934
|
|
|
|
|
1616
|
$str;
|
26
|
|
|
|
|
|
|
}
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _navi {
|
29
|
16
|
|
|
16
|
|
85
|
my %options = @_;
|
30
|
|
|
|
|
|
|
|
31
|
16
|
|
|
|
|
21
|
my $html =<<"EOT";
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
[top]
|
34
|
|
|
|
|
|
|
[stacktraces]
|
35
|
|
|
|
|
|
|
EOT
|
36
|
16
|
100
|
|
|
|
28
|
if (@{ $options{watchlist} }) {
|
|
16
|
|
|
|
|
48
|
|
37
|
4
|
|
|
|
|
9
|
$html .=<<"EOT";
|
38
|
|
|
|
|
|
|
[watchlist]
|
39
|
|
|
|
|
|
|
EOT
|
40
|
|
|
|
|
|
|
}
|
41
|
16
|
100
|
|
|
|
24
|
if (@{ $options{modules} }) {
|
|
16
|
|
|
|
|
41
|
|
42
|
4
|
|
|
|
|
11
|
$html .=<<"EOT";
|
43
|
|
|
|
|
|
|
[modules]
|
44
|
|
|
|
|
|
|
EOT
|
45
|
|
|
|
|
|
|
}
|
46
|
16
|
100
|
|
|
|
25
|
if (@{ $options{environment} }) {
|
|
16
|
|
|
|
|
52
|
|
47
|
4
|
|
|
|
|
10
|
$html .=<<"EOT";
|
48
|
|
|
|
|
|
|
[environment]
|
49
|
|
|
|
|
|
|
EOT
|
50
|
|
|
|
|
|
|
}
|
51
|
16
|
|
|
|
|
28
|
$html .=<<"EOT";
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
EOT
|
54
|
|
|
|
|
|
|
|
55
|
16
|
|
|
|
|
63
|
return $html;
|
56
|
|
|
|
|
|
|
}
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub _debug {
|
59
|
10
|
|
|
10
|
|
58
|
my ($pkg, %options) = @_;
|
60
|
|
|
|
|
|
|
|
61
|
10
|
|
|
|
|
30
|
my $error_at = _escape($options{error_at});
|
62
|
|
|
|
|
|
|
|
63
|
10
|
|
|
|
|
78
|
my $html =<<"EOT";
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Debug Screen
|
67
|
|
|
|
|
|
|
$options{style}
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
$error_at
|
73
|
|
|
|
|
|
|
EOT
|
74
|
|
|
|
|
|
|
|
75
|
10
|
100
|
|
|
|
29
|
if ($options{show_raw_error}) {
|
76
|
2
|
|
|
|
|
8
|
$html .=<<"EOT";
|
77
|
|
|
|
|
|
|
$options{raw_error}
|
78
|
|
|
|
|
|
|
EOT
|
79
|
|
|
|
|
|
|
}
|
80
|
|
|
|
|
|
|
else {
|
81
|
8
|
|
|
|
|
24
|
$html .=<<"EOT";
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
$options{error_message}
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
EOT
|
86
|
|
|
|
|
|
|
}
|
87
|
|
|
|
|
|
|
|
88
|
10
|
|
|
|
|
50
|
$html .= _navi(%options);
|
89
|
|
|
|
|
|
|
|
90
|
10
|
|
|
|
|
26
|
$html .=<<"EOT";
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
EOT
|
95
|
|
|
|
|
|
|
|
96
|
10
|
|
|
|
|
17
|
foreach my $stacktrace (@{ $options{stacktraces} }) {
|
|
10
|
|
|
|
|
28
|
|
97
|
30
|
|
|
|
|
81
|
my $caller = _escape($stacktrace->{caller});
|
98
|
30
|
|
|
|
|
58
|
my $line = $stacktrace->{line};
|
99
|
30
|
|
|
|
|
62
|
$html .=<<"EOT";
|
100
|
|
|
|
|
|
|
$caller LINE : $line
|
101
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
EOT
|
103
|
|
|
|
|
|
|
|
104
|
30
|
|
|
|
|
33
|
foreach my $line (@{ $stacktrace->{context} }) {
|
|
30
|
|
|
|
|
68
|
|
105
|
210
|
100
|
|
|
|
399
|
if ($line->{hit}) {
|
106
|
30
|
|
|
|
|
39
|
$html .=<<"EOT";
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
EOT
|
109
|
|
|
|
|
|
|
}
|
110
|
|
|
|
|
|
|
else {
|
111
|
180
|
|
|
|
|
199
|
$html .=<<"EOT";
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
EOT
|
114
|
|
|
|
|
|
|
}
|
115
|
210
|
|
|
|
|
336
|
my $line_no = _escape($line->{no});
|
116
|
210
|
|
|
|
|
371
|
my $line_body = _escape($line->{line});
|
117
|
210
|
|
|
|
|
610
|
$html .=<<"EOT";
|
118
|
|
|
|
|
|
|
| $line_no: | $line_body |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
EOT
|
121
|
|
|
|
|
|
|
}
|
122
|
30
|
|
|
|
|
66
|
$html .=<<"EOT";
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
EOT
|
125
|
|
|
|
|
|
|
}
|
126
|
|
|
|
|
|
|
|
127
|
10
|
|
|
|
|
18
|
$html .=<<"EOT";
|
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
EOT
|
131
|
|
|
|
|
|
|
|
132
|
10
|
100
|
|
|
|
16
|
if (@{ $options{watchlist} }) {
|
|
10
|
|
|
|
|
39
|
|
133
|
2
|
|
|
|
|
12
|
$html .= _navi(%options);
|
134
|
|
|
|
|
|
|
|
135
|
2
|
|
|
|
|
6
|
$html .=<<"EOT";
|
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
EOT
|
140
|
|
|
|
|
|
|
|
141
|
2
|
|
|
|
|
4
|
foreach my $watch (@{ $options{watchlist} }) {
|
|
2
|
|
|
|
|
5
|
|
142
|
2
|
|
|
|
|
6
|
my $key = _escape($watch->{key});
|
143
|
2
|
|
|
|
|
4
|
my $table = $watch->{value};
|
144
|
2
|
|
|
|
|
9
|
$html .=<<"EOT";
|
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
$key
|
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
$table
|
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
EOT
|
152
|
|
|
|
|
|
|
}
|
153
|
2
|
|
|
|
|
3
|
$html .=<<"EOT";
|
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
EOT
|
157
|
|
|
|
|
|
|
}
|
158
|
|
|
|
|
|
|
|
159
|
10
|
100
|
|
|
|
14
|
if (@{ $options{modules} }) {
|
|
10
|
|
|
|
|
35
|
|
160
|
2
|
|
|
|
|
10
|
$html .= _navi(%options);
|
161
|
|
|
|
|
|
|
|
162
|
2
|
|
|
|
|
7
|
$html .=<<"EOT";
|
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
EOT
|
167
|
|
|
|
|
|
|
|
168
|
2
|
|
|
|
|
4
|
foreach my $module (@{ $options{modules} }) {
|
|
2
|
|
|
|
|
5
|
|
169
|
167
|
|
|
|
|
283
|
my $package = _escape($module->{package});
|
170
|
167
|
|
|
|
|
292
|
my $file = _escape($module->{file});
|
171
|
|
|
|
|
|
|
|
172
|
167
|
|
|
|
|
361
|
$html .=<<"EOT";
|
173
|
|
|
|
|
|
|
$package ($file)
|
174
|
|
|
|
|
|
|
EOT
|
175
|
|
|
|
|
|
|
}
|
176
|
2
|
|
|
|
|
5
|
$html .=<<"EOT";
|
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
EOT
|
180
|
|
|
|
|
|
|
}
|
181
|
|
|
|
|
|
|
|
182
|
10
|
100
|
|
|
|
13
|
if (@{ $options{environment} }) {
|
|
10
|
|
|
|
|
31
|
|
183
|
2
|
|
|
|
|
10
|
$html .= _navi(%options);
|
184
|
|
|
|
|
|
|
|
185
|
2
|
|
|
|
|
7
|
$html .=<<"EOT";
|
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
EOT
|
190
|
|
|
|
|
|
|
|
191
|
2
|
|
|
|
|
4
|
foreach my $env (@{ $options{environment} }) {
|
|
2
|
|
|
|
|
6
|
|
192
|
44
|
|
|
|
|
78
|
my $key = _escape($env->{key});
|
193
|
44
|
|
|
|
|
80
|
my $value = _escape($env->{value});
|
194
|
44
|
|
|
|
|
225
|
$html .=<<"EOT";
|
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
| $key | $value /td>
|
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
EOT
|
199
|
|
|
|
|
|
|
}
|
200
|
2
|
|
|
|
|
5
|
$html .=<<"EOT";
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
EOT
|
204
|
|
|
|
|
|
|
}
|
205
|
|
|
|
|
|
|
|
206
|
10
|
|
|
|
|
23
|
my $version = _escape($options{version});
|
207
|
10
|
|
|
|
|
21
|
my $view = _escape($options{view});
|
208
|
|
|
|
|
|
|
|
209
|
10
|
|
|
|
|
31
|
$html .=<<"EOT";
|
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
EOT
|
215
|
|
|
|
|
|
|
|
216
|
10
|
|
|
|
|
264
|
return $html;
|
217
|
|
|
|
|
|
|
}
|
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
sub _error {
|
220
|
2
|
|
|
2
|
|
12
|
my ($pkg, %options) = @_;
|
221
|
|
|
|
|
|
|
|
222
|
30
|
|
|
|
|
58
|
my %escaped = map {
|
223
|
2
|
|
|
|
|
8
|
( $_, _escape($options{$_}) )
|
224
|
|
|
|
|
|
|
} keys %options;
|
225
|
|
|
|
|
|
|
|
226
|
2
|
|
|
|
|
26
|
my $html =<<"EOT";
|
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
An unexpected error has been detected
|
230
|
|
|
|
|
|
|
$options{style}
|
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
An unexpected error has been detected
|
235
|
|
|
|
|
|
|
Sorry for inconvenience.
|
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
EOT
|
240
|
|
|
|
|
|
|
|
241
|
2
|
|
|
|
|
28
|
return $html;
|
242
|
|
|
|
|
|
|
}
|
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
1;
|
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
__END__
|