This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update B-Debug to CPAN version 1.22
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Thu, 16 Oct 2014 11:29:13 +0000 (12:29 +0100)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Thu, 16 Oct 2014 11:29:13 +0000 (12:29 +0100)
  [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

Porting/Maintainers.pl
cpan/B-Debug/Debug.pm
cpan/B-Debug/t/debug.t

index 157c3a7..b8bd836 100755 (executable)
@@ -177,7 +177,7 @@ use File::Glob qw(:case);
     },
 
     'B::Debug' => {
-        'DISTRIBUTION' => 'RURBAN/B-Debug-1.21.tar.gz',
+        'DISTRIBUTION' => 'RURBAN/B-Debug-1.22.tar.gz',
         'FILES'        => q[cpan/B-Debug],
         'EXCLUDED'     => ['t/pod.t'],
     },
index e9a83ae..6f0c4c6 100644 (file)
@@ -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:
index 0af3bd9..f4f0a10 100644 (file)
@@ -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\]/);