line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DB; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Documentation is after __END__ |
4
|
|
|
|
|
|
|
|
5
|
12
|
|
|
|
|
1499
|
use vars qw( |
6
|
|
|
|
|
|
|
$OP_addr |
7
|
|
|
|
|
|
|
$OS_STARTUP_DIR |
8
|
|
|
|
|
|
|
$caller |
9
|
|
|
|
|
|
|
$eval_opts |
10
|
|
|
|
|
|
|
$eval_str |
11
|
|
|
|
|
|
|
$event |
12
|
|
|
|
|
|
|
$fall_off_on_end |
13
|
|
|
|
|
|
|
$init_dollar0 |
14
|
|
|
|
|
|
|
$ready $tid |
15
|
|
|
|
|
|
|
$ret |
16
|
|
|
|
|
|
|
$running |
17
|
|
|
|
|
|
|
$stop |
18
|
|
|
|
|
|
|
$bt_truncated |
19
|
|
|
|
|
|
|
%HAVE_MODULE |
20
|
|
|
|
|
|
|
@clients |
21
|
|
|
|
|
|
|
@ret |
22
|
12
|
|
|
12
|
|
82
|
@saved); |
|
12
|
|
|
|
|
33
|
|
23
|
|
|
|
|
|
|
|
24
|
12
|
|
|
12
|
|
87
|
use Cwd; |
|
12
|
|
|
|
|
31
|
|
|
12
|
|
|
|
|
774
|
|
25
|
|
|
|
|
|
|
BEGIN { |
26
|
12
|
|
|
12
|
|
72
|
no warnings 'once'; |
|
12
|
|
|
|
|
35
|
|
|
12
|
|
|
|
|
2336
|
|
27
|
|
|
|
|
|
|
# these are hardcoded in perl source (some are magical) |
28
|
|
|
|
|
|
|
|
29
|
12
|
|
|
12
|
|
59
|
$DB::sub = ''; # name of current subroutine |
30
|
12
|
|
|
|
|
35
|
$DB::single = 0; # single-step flags. See constants at the |
31
|
|
|
|
|
|
|
# top of DB/Sub.pm |
32
|
12
|
|
|
|
|
43
|
$DB::signal = 0; # signal flag (will cause a stop at the next line) |
33
|
12
|
|
|
|
|
34
|
$DB::stop = 0; # value of last breakpoint condition evaluation |
34
|
|
|
|
|
|
|
|
35
|
12
|
|
|
|
|
35
|
@DB::dbline = (); # list of lines in currently loaded file |
36
|
12
|
|
|
|
|
41
|
%DB::dbline = (); # actions in current file (keyed by line number) |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# other "public" globals |
39
|
|
|
|
|
|
|
|
40
|
12
|
|
|
|
|
103
|
@ini_INC = @INC; # Save the contents of @INC before they are |
41
|
|
|
|
|
|
|
# modified elsewhere. |
42
|
12
|
|
|
|
|
33
|
@ini_ARGV = @ARGV; |
43
|
12
|
|
|
|
|
46
|
$ini_dollar0 = $0; |
44
|
12
|
|
|
|
|
68
|
$OS_STARTUP_DIR = getcwd; |
45
|
|
|
|
|
|
|
|
46
|
12
|
|
|
|
|
32
|
@DB::args = (); # arguments of current subroutine or @ARGV array |
47
|
12
|
|
|
|
|
31
|
$DB::fall_off_on_end = 0; |
48
|
12
|
|
|
|
|
30
|
@DB::clients = (); |
49
|
12
|
|
|
|
|
32
|
$eval_opts = {}; # Options controlling how the client wants the |
50
|
|
|
|
|
|
|
# eval to take place |
51
|
12
|
|
|
|
|
32
|
$DB::tid = undef; # Thread id |
52
|
|
|
|
|
|
|
|
53
|
12
|
|
|
|
|
53
|
$DB::eval_str = ''; # Client wants to eval this string |
54
|
|
|
|
|
|
|
|
55
|
12
|
|
|
|
|
24
|
$DB::package = ''; # current package space |
56
|
12
|
|
|
|
|
28
|
$DB::filename = ''; # current filename |
57
|
12
|
|
|
|
|
32
|
$DB::subname = ''; # currently executing sub (fully qualified name) |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# This variable records how many levels we're nested in debugging. Used |
60
|
|
|
|
|
|
|
# Used in the debugger prompt, and in determining whether it's all over or |
61
|
|
|
|
|
|
|
# not. |
62
|
12
|
|
|
|
|
28
|
$DB::level = 0; # Level of nested debugging |
63
|
|
|
|
|
|
|
|
64
|
12
|
|
|
|
|
38
|
$DB::bitmask = ''; |
65
|
12
|
|
|
|
|
25
|
$DB::caller = []; |
66
|
12
|
|
|
|
|
30
|
$DB::evaltext = ''; |
67
|
12
|
|
|
|
|
35
|
$DB::hasargs = ''; |
68
|
12
|
|
|
|
|
27
|
$DB::hinthash = ''; |
69
|
12
|
|
|
|
|
23
|
$DB::hints = ''; |
70
|
12
|
|
|
|
|
31
|
$DB::is_require = ''; |
71
|
12
|
|
|
|
|
26
|
$DB::lineno = ''; # current line number |
72
|
12
|
|
|
|
|
22
|
$DB::subroutine = ''; |
73
|
12
|
|
|
|
|
34
|
$DB::wantarray = ''; |
74
|
|
|
|
|
|
|
|
75
|
12
|
|
|
|
|
27
|
$DB::event = undef; # The reason we have entered the debugger |
76
|
|
|
|
|
|
|
|
77
|
12
|
|
|
|
|
39
|
$DB::VERSION = '1.05'; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# initialize private globals to avoid warnings |
80
|
|
|
|
|
|
|
|
81
|
12
|
|
|
|
|
213
|
$DB::running = 1; # are we running, or are we stopped? |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
__END__ |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 Global Variables |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
The following "public" global names can be read by clients of this API. |
91
|
|
|
|
|
|
|
Beware that these should be considered "readonly". |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=over 8 |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item $DB::sub |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Name of current executing subroutine. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item %DB::sub |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
The keys of this hash are the names of all the known subroutines. |
102
|
|
|
|
|
|
|
Each value is an encoded string that has the sprintf(3) format |
103
|
|
|
|
|
|
|
C<("%s:%d-%d", filename, fromline, toline)>. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
This hash is maintained by Perl. I<filename> has the form (eval 34) for |
106
|
|
|
|
|
|
|
subroutines defined inside evals. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=item $DB::single |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Single-step flag. Will be true if the API will stop at the next statement. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=item $DB::signal |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Signal flag. Will be set to a true value if a signal was caught. Clients may |
115
|
|
|
|
|
|
|
check for this flag to abort time-consuming operations. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=item $DB::trace |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This flag is set to true if the API is tracing through subroutine calls. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=item @DB::args |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Contains the arguments of current subroutine, or the C<@ARGV> array if in the |
124
|
|
|
|
|
|
|
toplevel context. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=item @DB::dbline |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
List of lines in currently loaded file. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=item %DB::dbline |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
Actions in current file (keys are line numbers). The values are strings that |
133
|
|
|
|
|
|
|
have the sprintf(3) format C<("%s\000%s", breakcondition, actioncode)>. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=item $DB::package |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
Package namespace of currently executing code. |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item $DB::filename |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Currently loaded filename. |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=item $DB::subname |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
Fully qualified name of currently executing subroutine. |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=item $DB::lineno |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
Line number that will be executed next. |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=back |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=cut |