X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FB%2FB%2FDebug.pm;h=8b34a1d8af022e2c7e2abde8772f7f8fd6ad4736;hb=bb7c595be2e30a806b95ad83e9d3613aeb95c384;hp=92b91d2726b23a0d7514b09fc9b02392ea81b7e1;hpb=4522225b0b1dd6f5498ad893469cb9b2e20183b7;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/B/B/Debug.pm b/ext/B/B/Debug.pm index 92b91d2..8b34a1d 100644 --- a/ext/B/B/Debug.pm +++ b/ext/B/B/Debug.pm @@ -1,6 +1,6 @@ package B::Debug; -our $VERSION = '1.01'; +our $VERSION = '1.02'; use strict; use B qw(peekop class walkoptree walkoptree_exec @@ -11,14 +11,25 @@ my %done_gv; 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 @@ -216,10 +227,12 @@ sub B::AV::debug { $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 }