This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
resync with mainline
[perl5.git] / ext / B / B / Debug.pm
index d88cef3..8910068 100644 (file)
@@ -39,13 +39,6 @@ sub B::LOGOP::debug {
     printf "\top_other\t0x%x\n", ${$op->other};
 }
 
-sub B::CONDOP::debug {
-    my ($op) = @_;
-    $op->B::UNOP::debug();
-    printf "\top_true\t0x%x\n", ${$op->true};
-    printf "\top_false\t0x%x\n", ${$op->false};
-}
-
 sub B::LISTOP::debug {
     my ($op) = @_;
     $op->B::BINOP::debug();
@@ -68,13 +61,14 @@ sub B::COP::debug {
     my ($op) = @_;
     $op->B::OP::debug();
     my ($filegv) = $op->filegv;
-    printf <<'EOT', $op->label, ${$op->stash}, $$filegv, $op->seq, $op->arybase, $op->line;
+    printf <<'EOT', $op->label, ${$op->stash}, $$filegv, $op->seq, $op->arybase, $op->line, ${$op->warnings};
        cop_label       %s
        cop_stash       0x%x
        cop_filegv      0x%x
        cop_seq         %d
        cop_arybase     %d
        cop_line        %d
+       cop_warnings    0x%x
 EOT
     $filegv->debug;
 }
@@ -253,6 +247,7 @@ sub B::SPECIAL::debug {
 
 sub compile {
     my $order = shift;
+    B::clearsym();
     if ($order eq "exec") {
         return sub { walkoptree_exec(main_start, "debug") }
     } else {
@@ -261,3 +256,23 @@ sub compile {
 }
 
 1;
+
+__END__
+
+=head1 NAME
+
+B::Debug - Walk Perl syntax tree, printing debug info about ops
+
+=head1 SYNOPSIS
+
+       perl -MO=Debug[,OPTIONS] foo.pl
+
+=head1 DESCRIPTION
+
+See F<ext/B/README>.
+
+=head1 AUTHOR
+
+Malcolm Beattie, C<mbeattie@sable.ox.ac.uk>
+
+=cut