line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package B::Debug; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '1.24'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use strict; |
6
|
|
|
|
|
|
|
require 5.006; |
7
|
|
|
|
|
|
|
use B qw(peekop class walkoptree walkoptree_exec |
8
|
|
|
|
|
|
|
main_start main_root cstring sv_undef SVf_NOK SVf_IOK); |
9
|
|
|
|
|
|
|
use Config; |
10
|
|
|
|
|
|
|
my (@optype, @specialsv_name); |
11
|
|
|
|
|
|
|
require B; |
12
|
|
|
|
|
|
|
if ($] < 5.009) { |
13
|
|
|
|
|
|
|
require B::Asmdata; |
14
|
|
|
|
|
|
|
B::Asmdata->import (qw(@optype @specialsv_name)); |
15
|
|
|
|
|
|
|
} else { |
16
|
|
|
|
|
|
|
B->import (qw(@optype @specialsv_name)); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
if ($] < 5.006002) { |
20
|
|
|
|
|
|
|
eval q|sub B::GV::SAFENAME { |
21
|
|
|
|
|
|
|
my $name = (shift())->NAME; |
22
|
|
|
|
|
|
|
# The regex below corresponds to the isCONTROLVAR macro from toke.c |
23
|
|
|
|
|
|
|
$name =~ s/^([\cA-\cZ\c\\c[\c]\c?\c_\c^])/"^".chr(64 ^ ord($1))/e; |
24
|
|
|
|
|
|
|
return $name; |
25
|
|
|
|
|
|
|
}|; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my ($have_B_Flags, $have_B_Flags_extra); |
29
|
|
|
|
|
|
|
if (!$ENV{PERL_CORE}){ # avoid CORE test crashes |
30
|
|
|
|
|
|
|
eval { require B::Flags and $have_B_Flags++ }; |
31
|
|
|
|
|
|
|
$have_B_Flags_extra++ if $have_B_Flags and $B::Flags::VERSION gt '0.03'; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
my %done_gv; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub _printop { |
36
|
0
|
|
|
0
|
|
|
my $op = shift; |
37
|
0
|
0
|
|
|
|
|
my $addr = ${$op} ? $op->ppaddr : ''; |
|
0
|
|
|
|
|
|
|
38
|
0
|
0
|
|
|
|
|
$addr =~ s/^PL_ppaddr// if $addr; |
39
|
0
|
0
|
|
|
|
|
if (${$op}) { |
|
0
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return sprintf "0x%08x %6s %s", ${$op}, class($op), $addr; |
|
0
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
} else { |
42
|
0
|
|
|
|
|
|
return sprintf "0x%x %6s %s", ${$op}, '', $addr; |
|
0
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub B::OP::debug { |
47
|
0
|
|
|
0
|
|
|
my ($op) = @_; |
48
|
0
|
|
|
|
|
|
printf <<'EOT', class($op), $$op, _printop($op), _printop($op->next), _printop($op->sibling), $op->targ, $op->type, $op->name; |
49
|
|
|
|
|
|
|
%s (0x%lx) |
50
|
|
|
|
|
|
|
op_ppaddr %s |
51
|
|
|
|
|
|
|
op_next %s |
52
|
|
|
|
|
|
|
op_sibling %s |
53
|
|
|
|
|
|
|
op_targ %d |
54
|
|
|
|
|
|
|
op_type %d %s |
55
|
|
|
|
|
|
|
EOT |
56
|
0
|
0
|
|
|
|
|
if ($] > 5.009) { |
57
|
0
|
|
|
|
|
|
printf <<'EOT', $op->opt; |
58
|
|
|
|
|
|
|
op_opt %d |
59
|
|
|
|
|
|
|
EOT |
60
|
|
|
|
|
|
|
} else { |
61
|
0
|
|
|
|
|
|
printf <<'EOT', $op->seq; |
62
|
|
|
|
|
|
|
op_seq %d |
63
|
|
|
|
|
|
|
EOT |
64
|
|
|
|
|
|
|
} |
65
|
0
|
0
|
|
|
|
|
if ($have_B_Flags) { |
66
|
0
|
|
|
|
|
|
printf <<'EOT', $op->flags, $op->flagspv, $op->private, $op->privatepv; |
67
|
|
|
|
|
|
|
op_flags %d %s |
68
|
|
|
|
|
|
|
op_private %d %s |
69
|
|
|
|
|
|
|
EOT |
70
|
|
|
|
|
|
|
} else { |
71
|
0
|
|
|
|
|
|
printf <<'EOT', $op->flags, $op->private; |
72
|
|
|
|
|
|
|
op_flags %d |
73
|
|
|
|
|
|
|
op_private %d |
74
|
|
|
|
|
|
|
EOT |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub B::UNOP::debug { |
79
|
0
|
|
|
0
|
|
|
my ($op) = @_; |
80
|
0
|
|
|
|
|
|
$op->B::OP::debug(); |
81
|
0
|
|
|
|
|
|
printf "\top_first\t%s\n", _printop($op->first); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub B::BINOP::debug { |
85
|
0
|
|
|
0
|
|
|
my ($op) = @_; |
86
|
0
|
|
|
|
|
|
$op->B::UNOP::debug(); |
87
|
0
|
|
|
|
|
|
printf "\top_last \t%s\n", _printop($op->last); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub B::LOOP::debug { |
91
|
0
|
|
|
0
|
|
|
my ($op) = @_; |
92
|
0
|
|
|
|
|
|
$op->B::BINOP::debug(); |
93
|
0
|
|
|
|
|
|
printf <<'EOT', _printop($op->redoop), _printop($op->nextop), _printop($op->lastop); |
94
|
|
|
|
|
|
|
op_redoop %s |
95
|
|
|
|
|
|
|
op_nextop %s |
96
|
|
|
|
|
|
|
op_lastop %s |
97
|
|
|
|
|
|
|
EOT |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub B::LOGOP::debug { |
101
|
0
|
|
|
0
|
|
|
my ($op) = @_; |
102
|
0
|
|
|
|
|
|
$op->B::UNOP::debug(); |
103
|
0
|
|
|
|
|
|
printf "\top_other\t%s\n", _printop($op->other); |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub B::LISTOP::debug { |
107
|
0
|
|
|
0
|
|
|
my ($op) = @_; |
108
|
0
|
|
|
|
|
|
$op->B::BINOP::debug(); |
109
|
0
|
|
|
|
|
|
printf "\top_children\t%d\n", $op->children; |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub B::PMOP::debug { |
113
|
0
|
|
|
0
|
|
|
my ($op) = @_; |
114
|
0
|
|
|
|
|
|
$op->B::LISTOP::debug(); |
115
|
0
|
0
|
|
|
|
|
printf "\top_pmreplroot\t0x%x\n", $] < 5.008 ? ${$op->pmreplroot} : $op->pmreplroot; |
|
0
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
|
printf "\top_pmreplstart\t0x%x\n", ${$op->pmreplstart}; |
|
0
|
|
|
|
|
|
|
117
|
0
|
0
|
|
|
|
|
printf "\top_pmnext\t0x%x\n", ${$op->pmnext} if $] < 5.009005; |
|
0
|
|
|
|
|
|
|
118
|
0
|
0
|
|
|
|
|
if ($Config{'useithreads'}) { |
119
|
0
|
|
|
|
|
|
printf "\top_pmstashpv\t%s\n", cstring($op->pmstashpv); |
120
|
0
|
|
|
|
|
|
printf "\top_pmoffset\t%d\n", $op->pmoffset; |
121
|
|
|
|
|
|
|
} else { |
122
|
0
|
|
|
|
|
|
printf "\top_pmstash\t%s\n", cstring($op->pmstash); |
123
|
|
|
|
|
|
|
} |
124
|
0
|
|
|
|
|
|
printf "\top_precomp\t%s\n", cstring($op->precomp); |
125
|
0
|
|
|
|
|
|
printf "\top_pmflags\t0x%x\n", $op->pmflags; |
126
|
0
|
0
|
|
|
|
|
printf "\top_reflags\t0x%x\n", $op->reflags if $] >= 5.009; |
127
|
0
|
0
|
|
|
|
|
printf "\top_pmpermflags\t0x%x\n", $op->pmpermflags if $] < 5.009; |
128
|
0
|
0
|
|
|
|
|
printf "\top_pmdynflags\t0x%x\n", $op->pmdynflags if $] < 5.009; |
129
|
0
|
0
|
|
|
|
|
$op->pmreplroot->debug if $] < 5.008; |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub B::COP::debug { |
133
|
0
|
|
|
0
|
|
|
my ($op) = @_; |
134
|
0
|
|
|
|
|
|
$op->B::OP::debug(); |
135
|
0
|
0
|
|
|
|
|
my $warnings = ref $op->warnings ? ${$op->warnings} : 0; |
|
0
|
|
|
|
|
|
|
136
|
0
|
|
|
|
|
|
printf <<'EOT', $op->label, $op->stashpv, $op->file, $op->cop_seq, $op->arybase, $op->line, $warnings; |
137
|
|
|
|
|
|
|
cop_label "%s" |
138
|
|
|
|
|
|
|
cop_stashpv "%s" |
139
|
|
|
|
|
|
|
cop_file "%s" |
140
|
|
|
|
|
|
|
cop_seq %d |
141
|
|
|
|
|
|
|
cop_arybase %d |
142
|
|
|
|
|
|
|
cop_line %d |
143
|
|
|
|
|
|
|
cop_warnings 0x%x |
144
|
|
|
|
|
|
|
EOT |
145
|
0
|
0
|
0
|
|
|
|
if ($] > 5.008 and $] < 5.011) { |
146
|
0
|
0
|
|
|
|
|
my $cop_io = class($op->io) eq 'SPECIAL' ? '' : $op->io->as_string; |
147
|
0
|
|
|
|
|
|
printf(" cop_io %s\n", cstring($cop_io)); |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub B::SVOP::debug { |
152
|
0
|
|
|
0
|
|
|
my ($op) = @_; |
153
|
0
|
|
|
|
|
|
$op->B::OP::debug(); |
154
|
0
|
|
|
|
|
|
printf "\top_sv\t\t0x%x\n", ${$op->sv}; |
|
0
|
|
|
|
|
|
|
155
|
0
|
|
|
|
|
|
$op->sv->debug; |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
sub B::METHOP::debug { |
159
|
0
|
|
|
0
|
|
|
my ($op) = @_; |
160
|
0
|
|
|
|
|
|
$op->B::OP::debug(); |
161
|
0
|
0
|
|
|
|
|
if (${$op->first}) { |
|
0
|
|
|
|
|
|
|
162
|
0
|
|
|
|
|
|
printf "\top_first\t0x%x\n", ${$op->first}; |
|
0
|
|
|
|
|
|
|
163
|
0
|
|
|
|
|
|
$op->first->debug; |
164
|
|
|
|
|
|
|
} else { |
165
|
0
|
|
|
|
|
|
printf "\top_meth_sv\t0x%x\n", ${$op->meth_sv}; |
|
0
|
|
|
|
|
|
|
166
|
0
|
|
|
|
|
|
$op->meth_sv->debug; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
sub B::PVOP::debug { |
171
|
0
|
|
|
0
|
|
|
my ($op) = @_; |
172
|
0
|
|
|
|
|
|
$op->B::OP::debug(); |
173
|
0
|
|
|
|
|
|
printf "\top_pv\t\t%s\n", cstring($op->pv); |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
sub B::PADOP::debug { |
177
|
0
|
|
|
0
|
|
|
my ($op) = @_; |
178
|
0
|
|
|
|
|
|
$op->B::OP::debug(); |
179
|
0
|
|
|
|
|
|
printf "\top_padix\t%ld\n", $op->padix; |
180
|
|
|
|
|
|
|
} |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
sub B::NULL::debug { |
183
|
0
|
|
|
0
|
|
|
my ($sv) = @_; |
184
|
0
|
0
|
|
|
|
|
if ($$sv == ${sv_undef()}) { |
|
0
|
|
|
|
|
|
|
185
|
0
|
|
|
|
|
|
print "&sv_undef\n"; |
186
|
|
|
|
|
|
|
} else { |
187
|
0
|
|
|
|
|
|
printf "NULL (0x%x)\n", $$sv; |
188
|
|
|
|
|
|
|
} |
189
|
|
|
|
|
|
|
} |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
sub B::SV::debug { |
192
|
0
|
|
|
0
|
|
|
my ($sv) = @_; |
193
|
0
|
0
|
|
|
|
|
if (!$$sv) { |
194
|
0
|
|
|
|
|
|
print class($sv), " = NULL\n"; |
195
|
0
|
|
|
|
|
|
return; |
196
|
|
|
|
|
|
|
} |
197
|
0
|
|
|
|
|
|
printf <<'EOT', class($sv), $$sv, $sv->REFCNT; |
198
|
|
|
|
|
|
|
%s (0x%x) |
199
|
|
|
|
|
|
|
REFCNT %d |
200
|
|
|
|
|
|
|
EOT |
201
|
0
|
|
|
|
|
|
printf "\tFLAGS\t\t0x%x", $sv->FLAGS; |
202
|
0
|
0
|
|
|
|
|
if ($have_B_Flags) { |
203
|
0
|
0
|
|
|
|
|
printf "\t%s", $have_B_Flags_extra ? $sv->flagspv(0) : $sv->flagspv; |
204
|
|
|
|
|
|
|
} |
205
|
0
|
|
|
|
|
|
print "\n"; |
206
|
|
|
|
|
|
|
} |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
sub B::RV::debug { |
209
|
0
|
|
|
0
|
|
|
my ($rv) = @_; |
210
|
0
|
|
|
|
|
|
B::SV::debug($rv); |
211
|
0
|
|
|
|
|
|
printf <<'EOT', ${$rv->RV}; |
|
0
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
RV 0x%x |
213
|
|
|
|
|
|
|
EOT |
214
|
0
|
|
|
|
|
|
$rv->RV->debug; |
215
|
|
|
|
|
|
|
} |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
sub B::PV::debug { |
218
|
0
|
|
|
0
|
|
|
my ($sv) = @_; |
219
|
0
|
|
|
|
|
|
$sv->B::SV::debug(); |
220
|
0
|
|
|
|
|
|
my $pv = $sv->PV(); |
221
|
0
|
|
|
|
|
|
printf <<'EOT', cstring($pv), $sv->CUR, $sv->LEN; |
222
|
|
|
|
|
|
|
xpv_pv %s |
223
|
|
|
|
|
|
|
xpv_cur %d |
224
|
|
|
|
|
|
|
xpv_len %d |
225
|
|
|
|
|
|
|
EOT |
226
|
|
|
|
|
|
|
} |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
sub B::IV::debug { |
229
|
0
|
|
|
0
|
|
|
my ($sv) = @_; |
230
|
0
|
|
|
|
|
|
$sv->B::SV::debug(); |
231
|
0
|
0
|
|
|
|
|
printf "\txiv_iv\t\t%d\n", $sv->IV if $sv->FLAGS & SVf_IOK; |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
sub B::NV::debug { |
235
|
0
|
|
|
0
|
|
|
my ($sv) = @_; |
236
|
0
|
|
|
|
|
|
$sv->B::IV::debug(); |
237
|
0
|
0
|
|
|
|
|
printf "\txnv_nv\t\t%s\n", $sv->NV if $sv->FLAGS & SVf_NOK; |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
sub B::PVIV::debug { |
241
|
0
|
|
|
0
|
|
|
my ($sv) = @_; |
242
|
0
|
|
|
|
|
|
$sv->B::PV::debug(); |
243
|
0
|
0
|
|
|
|
|
printf "\txiv_iv\t\t%d\n", $sv->IV if $sv->FLAGS & SVf_IOK; |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
sub B::PVNV::debug { |
247
|
0
|
|
|
0
|
|
|
my ($sv) = @_; |
248
|
0
|
|
|
|
|
|
$sv->B::PVIV::debug(); |
249
|
0
|
0
|
|
|
|
|
printf "\txnv_nv\t\t%s\n", $sv->NV if $sv->FLAGS & SVf_NOK; |
250
|
|
|
|
|
|
|
} |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
sub B::PVLV::debug { |
253
|
0
|
|
|
0
|
|
|
my ($sv) = @_; |
254
|
0
|
|
|
|
|
|
$sv->B::PVNV::debug(); |
255
|
0
|
|
|
|
|
|
printf "\txlv_targoff\t%d\n", $sv->TARGOFF; |
256
|
0
|
|
|
|
|
|
printf "\txlv_targlen\t%u\n", $sv->TARGLEN; |
257
|
0
|
|
|
|
|
|
printf "\txlv_type\t%s\n", cstring(chr($sv->TYPE)); |
258
|
|
|
|
|
|
|
} |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
sub B::BM::debug { |
261
|
0
|
|
|
0
|
|
|
my ($sv) = @_; |
262
|
0
|
|
|
|
|
|
$sv->B::PVNV::debug(); |
263
|
0
|
|
|
|
|
|
printf "\txbm_useful\t%d\n", $sv->USEFUL; |
264
|
0
|
|
|
|
|
|
printf "\txbm_previous\t%u\n", $sv->PREVIOUS; |
265
|
0
|
|
|
|
|
|
printf "\txbm_rare\t%s\n", cstring(chr($sv->RARE)); |
266
|
|
|
|
|
|
|
} |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
sub B::CV::debug { |
269
|
0
|
|
|
0
|
|
|
my ($sv) = @_; |
270
|
0
|
|
|
|
|
|
$sv->B::PVNV::debug(); |
271
|
0
|
|
|
|
|
|
my ($stash) = $sv->STASH; |
272
|
0
|
|
|
|
|
|
my ($start) = $sv->START; |
273
|
0
|
|
|
|
|
|
my ($root) = $sv->ROOT; |
274
|
0
|
|
|
|
|
|
my ($padlist) = $sv->PADLIST; |
275
|
0
|
|
|
|
|
|
my ($file) = $sv->FILE; |
276
|
0
|
|
|
|
|
|
my ($gv) = $sv->GV; |
277
|
0
|
|
|
|
|
|
printf <<'EOT', $$stash, $$start, $$root; |
278
|
|
|
|
|
|
|
STASH 0x%x |
279
|
|
|
|
|
|
|
START 0x%x |
280
|
|
|
|
|
|
|
ROOT 0x%x |
281
|
|
|
|
|
|
|
EOT |
282
|
0
|
0
|
0
|
|
|
|
if ( $]>5.017 && ($sv->FLAGS & 0x40000)) { #lexsub |
283
|
0
|
|
|
|
|
|
printf("\tNAME\t%%s\n", $sv->NAME); |
284
|
|
|
|
|
|
|
} else { |
285
|
0
|
|
|
|
|
|
printf("\tGV\t%0x%x\t%s\n", $$gv, $gv->SAFENAME); |
286
|
|
|
|
|
|
|
} |
287
|
0
|
|
|
|
|
|
printf <<'EOT', $file, $sv->DEPTH, $padlist, ${$sv->OUTSIDE}; |
|
0
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
FILE %s |
289
|
|
|
|
|
|
|
DEPTH %d |
290
|
|
|
|
|
|
|
PADLIST 0x%x |
291
|
|
|
|
|
|
|
OUTSIDE 0x%x |
292
|
|
|
|
|
|
|
EOT |
293
|
0
|
0
|
|
|
|
|
printf("\tOUTSIDE_SEQ\t%d\n", $sv->OUTSIDE_SEQ) if $] > 5.007; |
294
|
0
|
0
|
|
|
|
|
if ($have_B_Flags) { |
295
|
0
|
0
|
|
|
|
|
my $SVt_PVCV = $] < 5.010 ? 12 : 13; |
296
|
0
|
0
|
|
|
|
|
printf("\tCvFLAGS\t0x%x\t%s\n", $sv->CvFLAGS, |
297
|
|
|
|
|
|
|
$have_B_Flags_extra ? $sv->flagspv($SVt_PVCV) : $sv->flagspv); |
298
|
|
|
|
|
|
|
} else { |
299
|
0
|
|
|
|
|
|
printf("\tCvFLAGS\t0x%x\n", $sv->CvFLAGS); |
300
|
|
|
|
|
|
|
} |
301
|
0
|
0
|
|
|
|
|
$start->debug if $start; |
302
|
0
|
0
|
|
|
|
|
$root->debug if $root; |
303
|
0
|
0
|
|
|
|
|
$gv->debug if $gv; |
304
|
0
|
0
|
|
|
|
|
$padlist->debug if $padlist; |
305
|
|
|
|
|
|
|
} |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
sub B::AV::debug { |
308
|
0
|
|
|
0
|
|
|
my ($av) = @_; |
309
|
0
|
|
|
|
|
|
$av->B::SV::debug; |
310
|
0
|
|
|
|
|
|
_array_debug($av); |
311
|
|
|
|
|
|
|
} |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
sub _array_debug { |
314
|
0
|
|
|
0
|
|
|
my ($av) = @_; |
315
|
|
|
|
|
|
|
# tied arrays may leave out FETCHSIZE |
316
|
0
|
|
|
|
|
|
my (@array) = eval { $av->ARRAY; }; |
|
0
|
|
|
|
|
|
|
317
|
0
|
|
|
|
|
|
print "\tARRAY\t\t(", join(", ", map("0x" . $$_, @array)), ")\n"; |
318
|
0
|
|
|
|
|
|
my $fill = eval { scalar(@array) }; |
|
0
|
|
|
|
|
|
|
319
|
0
|
0
|
0
|
|
|
|
if ($Config{'useithreads'} && class($av) ne 'PADLIST') { |
320
|
0
|
|
|
|
|
|
printf <<'EOT', $fill, $av->MAX, $av->OFF; |
321
|
|
|
|
|
|
|
FILL %d |
322
|
|
|
|
|
|
|
MAX %d |
323
|
|
|
|
|
|
|
OFF %d |
324
|
|
|
|
|
|
|
EOT |
325
|
|
|
|
|
|
|
} else { |
326
|
0
|
|
|
|
|
|
printf <<'EOT', $fill, $av->MAX; |
327
|
|
|
|
|
|
|
FILL %d |
328
|
|
|
|
|
|
|
MAX %d |
329
|
|
|
|
|
|
|
EOT |
330
|
|
|
|
|
|
|
} |
331
|
0
|
0
|
|
|
|
|
if ($] < 5.009) { |
332
|
0
|
0
|
|
|
|
|
if ($have_B_Flags) { |
333
|
0
|
0
|
|
|
|
|
printf("\tAvFLAGS\t0x%x\t%s\n", $av->AvFLAGS, |
334
|
|
|
|
|
|
|
$have_B_Flags_extra ? $av->flagspv(10) : $av->flagspv); |
335
|
|
|
|
|
|
|
} else { |
336
|
0
|
|
|
|
|
|
printf("\tAvFLAGS\t0x%x\n", $av->AvFLAGS); |
337
|
|
|
|
|
|
|
} |
338
|
|
|
|
|
|
|
} |
339
|
|
|
|
|
|
|
} |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
sub B::GV::debug { |
342
|
0
|
|
|
0
|
|
|
my ($gv) = @_; |
343
|
0
|
0
|
|
|
|
|
if ($done_gv{$$gv}++) { |
344
|
0
|
|
|
|
|
|
printf "GV %s::%s\n", $gv->STASH->NAME, $gv->SAFENAME; |
345
|
0
|
|
|
|
|
|
return; |
346
|
|
|
|
|
|
|
} |
347
|
0
|
|
|
|
|
|
my $sv = $gv->SV; |
348
|
0
|
|
|
|
|
|
my $av = $gv->AV; |
349
|
0
|
|
|
|
|
|
my $cv = $gv->CV; |
350
|
0
|
|
|
|
|
|
$gv->B::SV::debug; |
351
|
0
|
|
|
|
|
|
printf <<'EOT', $gv->SAFENAME, $gv->STASH->NAME, $gv->STASH, $$sv, $gv->GvREFCNT, $gv->FORM, $$av, ${$gv->HV}, ${$gv->EGV}, $$cv, $gv->CVGEN, $gv->LINE, $gv->FILE, $gv->GvFLAGS; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
NAME %s |
353
|
|
|
|
|
|
|
STASH %s (0x%x) |
354
|
|
|
|
|
|
|
SV 0x%x |
355
|
|
|
|
|
|
|
GvREFCNT %d |
356
|
|
|
|
|
|
|
FORM 0x%x |
357
|
|
|
|
|
|
|
AV 0x%x |
358
|
|
|
|
|
|
|
HV 0x%x |
359
|
|
|
|
|
|
|
EGV 0x%x |
360
|
|
|
|
|
|
|
CV 0x%x |
361
|
|
|
|
|
|
|
CVGEN %d |
362
|
|
|
|
|
|
|
LINE %d |
363
|
|
|
|
|
|
|
FILE %s |
364
|
|
|
|
|
|
|
EOT |
365
|
0
|
0
|
|
|
|
|
if ($have_B_Flags) { |
366
|
0
|
0
|
|
|
|
|
my $SVt_PVGV = $] < 5.010 ? 13 : 9; |
367
|
0
|
0
|
|
|
|
|
printf("\tGvFLAGS\t0x%x\t%s\n", $gv->GvFLAGS, |
368
|
|
|
|
|
|
|
$have_B_Flags_extra ? $gv->flagspv($SVt_PVGV) : $gv->flagspv); |
369
|
|
|
|
|
|
|
} else { |
370
|
0
|
|
|
|
|
|
printf("\tGvFLAGS\t0x%x\n", $gv->GvFLAGS); |
371
|
|
|
|
|
|
|
} |
372
|
0
|
0
|
|
|
|
|
$sv->debug if $sv; |
373
|
0
|
0
|
|
|
|
|
$av->debug if $av; |
374
|
0
|
0
|
|
|
|
|
$cv->debug if $cv; |
375
|
|
|
|
|
|
|
} |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
sub B::SPECIAL::debug { |
378
|
0
|
|
|
0
|
|
|
my $sv = shift; |
379
|
0
|
0
|
|
|
|
|
my $i = ref $sv ? $$sv : 0; |
380
|
0
|
0
|
|
|
|
|
print defined $specialsv_name[$i] ? $specialsv_name[$i] : "", "\n"; |
381
|
|
|
|
|
|
|
} |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
sub B::PADLIST::debug { |
384
|
0
|
|
|
0
|
|
|
my ($padlist) = @_; |
385
|
0
|
|
|
|
|
|
printf <<'EOT', class($padlist), $$padlist, $padlist->REFCNT; |
386
|
|
|
|
|
|
|
%s (0x%x) |
387
|
|
|
|
|
|
|
REFCNT %d |
388
|
|
|
|
|
|
|
EOT |
389
|
0
|
|
|
|
|
|
_array_debug($padlist); |
390
|
|
|
|
|
|
|
} |
391
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
sub compile { |
393
|
0
|
|
|
0
|
0
|
|
my $order = shift; |
394
|
0
|
|
|
|
|
|
B::clearsym(); |
395
|
0
|
0
|
|
|
|
|
$DB::single = 1 if defined &DB::DB; |
396
|
0
|
0
|
0
|
|
|
|
if ($order && $order eq "exec") { |
397
|
0
|
|
|
0
|
|
|
return sub { walkoptree_exec(main_start, "debug") } |
398
|
0
|
|
|
|
|
|
} else { |
399
|
0
|
|
|
0
|
|
|
return sub { walkoptree(main_root, "debug") } |
400
|
0
|
|
|
|
|
|
} |
401
|
|
|
|
|
|
|
} |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
1; |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
__END__ |