package B::Debug;
-our $VERSION = '1.00';
+our $VERSION = '1.02';
use strict;
use B qw(peekop class walkoptree walkoptree_exec
sub B::OP::debug {
my ($op) = @_;
- printf <<'EOT', class($op), $$op, ${$op->next}, ${$op->sibling}, $op->ppaddr, $op->targ, $op->type, $op->seq, $op->flags, $op->private;
+ printf <<'EOT', class($op), $$op, ${$op->next}, ${$op->sibling}, $op->ppaddr, $op->targ, $op->type;
%s (0x%lx)
op_next 0x%x
op_sibling 0x%x
op_ppaddr %s
op_targ %d
op_type %d
+EOT
+ if ($] > 5.009) {
+ printf <<'EOT', $op->opt, $op->static;
+ op_opt %d
+ op_static %d
+EOT
+ } else {
+ printf <<'EOT', $op->seq;
op_seq %d
+EOT
+ }
+ printf <<'EOT', $op->flags, $op->private;
op_flags %d
op_private %d
EOT
my ($op) = @_;
$op->B::OP::debug();
my $cop_io = class($op->io) eq 'SPECIAL' ? '' : $op->io->as_string;
- printf <<'EOT', $op->label, $op->stashpv, $op->file, $op->seq, $op->arybase, $op->line, ${$op->warnings}, cstring($cop_io);
+ printf <<'EOT', $op->label, $op->stashpv, $op->file, $op->cop_seq, $op->arybase, $op->line, ${$op->warnings}, cstring($cop_io);
cop_label %s
cop_stashpv %s
cop_file %s
printf "\top_padix\t\t%ld\n", $op->padix;
}
-sub B::CVOP::debug {
- my ($op) = @_;
- $op->B::OP::debug();
- printf "\top_cv\t\t0x%x\n", ${$op->cv};
-}
-
sub B::NULL::debug {
my ($sv) = @_;
if ($$sv == ${sv_undef()}) {
$av->B::SV::debug;
my(@array) = $av->ARRAY;
print "\tARRAY\t\t(", join(", ", map("0x" . $$_, @array)), ")\n";
- printf <<'EOT', scalar(@array), $av->MAX, $av->OFF, $av->AvFLAGS;
+ printf <<'EOT', scalar(@array), $av->MAX, $av->OFF;
FILL %d
MAX %d
OFF %d
+EOT
+ printf <<'EOT', $av->AvFLAGS if $] < 5.009;
AvFLAGS %d
EOT
}