summaryrefslogtreecommitdiff
path: root/cpan/B-Debug
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2014-10-16 12:29:13 +0100
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2014-10-16 12:29:13 +0100
commit5b615f05fa936a4d25984453e5dfbd4e32cc8f5b (patch)
tree23a8ca7587cff07ef8146767eab19e81d04cce8a /cpan/B-Debug
parent9c71c2c57ff730c06c50ae800ee5e7652be91895 (diff)
downloadperl-5b615f05fa936a4d25984453e5dfbd4e32cc8f5b.tar.gz
Update B-Debug to CPAN version 1.22
[DELTA] 1.22 2014-10-12 rurban * add 5.21.5 support: changed test, from blead for split optim., added METHOP * print 0x00000000 as 0x0 * add -d -MOd=Debug support * README: fixed copyright date
Diffstat (limited to 'cpan/B-Debug')
-rw-r--r--cpan/B-Debug/Debug.pm23
-rw-r--r--cpan/B-Debug/t/debug.t6
2 files changed, 25 insertions, 4 deletions
diff --git a/cpan/B-Debug/Debug.pm b/cpan/B-Debug/Debug.pm
index e9a83ae73b..6f0c4c6b2e 100644
--- a/cpan/B-Debug/Debug.pm
+++ b/cpan/B-Debug/Debug.pm
@@ -1,6 +1,6 @@
package B::Debug;
-our $VERSION = '1.21';
+our $VERSION = '1.22';
use strict;
require 5.006;
@@ -36,7 +36,11 @@ sub _printop {
my $op = shift;
my $addr = ${$op} ? $op->ppaddr : '';
$addr =~ s/^PL_ppaddr// if $addr;
- return sprintf "0x%08x %6s %s", ${$op}, ${$op} ? class($op) : '', $addr;
+ if (${$op}) {
+ return sprintf "0x%08x %6s %s", ${$op}, class($op), $addr;
+ } else {
+ return sprintf "0x%x %6s %s", ${$op}, '', $addr;
+ }
}
sub B::OP::debug {
@@ -151,6 +155,18 @@ sub B::SVOP::debug {
$op->sv->debug;
}
+sub B::METHOP::debug {
+ my ($op) = @_;
+ $op->B::OP::debug();
+ if (${$op->first}) {
+ printf "\top_first\t0x%x\n", ${$op->first};
+ $op->first->debug;
+ } else {
+ printf "\top_meth_sv\t0x%x\n", ${$op->meth_sv};
+ $op->meth_sv->debug;
+ }
+}
+
sub B::PVOP::debug {
my ($op) = @_;
$op->B::OP::debug();
@@ -376,6 +392,7 @@ EOT
sub compile {
my $order = shift;
B::clearsym();
+ $DB::single = 1 if defined &DB::DB;
if ($order && $order eq "exec") {
return sub { walkoptree_exec(main_start, "debug") }
} else {
@@ -413,7 +430,7 @@ Reini Urban C<rurban@cpan.org>
=head1 LICENSE
Copyright (c) 1996, 1997 Malcolm Beattie
-Copyright (c) 2008, 2010, 2013 Reini Urban
+Copyright (c) 2008, 2010, 2013, 2014 Reini Urban
This program is free software; you can redistribute it and/or modify
it under the terms of either:
diff --git a/cpan/B-Debug/t/debug.t b/cpan/B-Debug/t/debug.t
index 0af3bd9fdb..f4f0a10563 100644
--- a/cpan/B-Debug/t/debug.t
+++ b/cpan/B-Debug/t/debug.t
@@ -75,7 +75,11 @@ EOF
#$b .= " nextstate" if $] < 5.008001; # ??
$b=~s/\n/ /g; $b=~s/\s+/ /g;
$b =~ s/\s+$//;
-is($a, $b);
+
+TODO: {
+ local $TODO = '5.21.5 split optimization' if $] == 5.021005;
+ is($a, $b);
+}
like(B::Debug::_printop(B::main_root), qr/LISTOP\s+\[OP_LEAVE\]/);
like(B::Debug::_printop(B::main_start), qr/OP\s+\[OP_ENTER\]/);