our $VERSION = '1.02_01';
use B
qw(peekop class walkoptree walkoptree_exec
main_start main_root cstring sv_undef);
use B
::Asmdata
qw(@specialsv_name);
printf <<'EOT', class($op), $$op, ${$op->next}, ${$op->sibling}, $op->ppaddr, $op->targ, $op->type;
printf <<'EOT', $op->opt, $op->static;
printf <<'EOT', $op->seq;
printf <<'EOT', $op->flags, $op->private;
printf "\top_first\t0x%x\n", ${$op->first};
printf "\top_last\t\t0x%x\n", ${$op->last};
printf <<'EOT', ${$op->redoop}, ${$op->nextop}, ${$op->lastop};
printf "\top_other\t0x%x\n", ${$op->other};
printf "\top_children\t%d\n", $op->children;
printf "\top_pmreplroot\t0x%x\n", ${$op->pmreplroot};
printf "\top_pmreplstart\t0x%x\n", ${$op->pmreplstart};
printf "\top_pmnext\t0x%x\n", ${$op->pmnext};
printf "\top_pmregexp->precomp\t%s\n", cstring
($op->precomp);
printf "\top_pmflags\t0x%x\n", $op->pmflags;
my $cop_io = class($op->io) eq 'SPECIAL' ?
'' : $op->io->as_string;
printf <<'EOT', $op->label, $op->stashpv, $op->file, $op->cop_seq, $op->arybase, $op->line, ${$op->warnings}, cstring($cop_io);
printf "\top_sv\t\t0x%x\n", ${$op->sv};
printf "\top_pv\t\t%s\n", cstring
($op->pv);
printf "\top_padix\t\t%ld\n", $op->padix;
if ($$sv == ${sv_undef
()}) {
printf "NULL (0x%x)\n", $$sv;
print class($sv), " = NULL\n";
printf <<'EOT', class($sv), $$sv, $sv->REFCNT, $sv->FLAGS;
printf <<'EOT', ${$rv->RV};
printf <<'EOT', cstring($pv), length($pv);
printf "\txiv_iv\t\t%d\n", $sv->IV;
printf "\txnv_nv\t\t%s\n", $sv->NV;
printf "\txiv_iv\t\t%d\n", $sv->IV;
printf "\txnv_nv\t\t%s\n", $sv->NV;
printf "\txlv_targoff\t%d\n", $sv->TARGOFF;
printf "\txlv_targlen\t%u\n", $sv->TARGLEN;
printf "\txlv_type\t%s\n", cstring
(chr($sv->TYPE));
printf "\txbm_useful\t%d\n", $sv->USEFUL;
printf "\txbm_previous\t%u\n", $sv->PREVIOUS;
printf "\txbm_rare\t%s\n", cstring
(chr($sv->RARE));
my ($stash) = $sv->STASH;
my ($start) = $sv->START;
my ($padlist) = $sv->PADLIST;
printf <<'EOT', $$stash, $$start, $$root, $$gv, $file, $sv->DEPTH, $padlist, ${$sv->OUTSIDE}, $sv->OUTSIDE_SEQ;
$padlist->debug if $padlist;
print "\tARRAY\t\t(", join(", ", map("0x" . $$_, @array)), ")\n";
printf <<'EOT', scalar(@array), $av->MAX, $av->OFF;
printf <<'EOT', $av->AvFLAGS if $] < 5.009;
printf "GV %s::%s\n", $gv->STASH->NAME, $gv->SAFENAME;
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;
print $specialsv_name[$$sv], "\n";
if ($order && $order eq "exec") {
return sub { walkoptree_exec
(main_start
, "debug") }
return sub { walkoptree
(main_root
, "debug") }
B::Debug - Walk Perl syntax tree, printing debug info about ops
perl -MO=Debug[,OPTIONS] foo.pl
Malcolm Beattie, C<mbeattie@sable.ox.ac.uk>