Change 18856 by [EMAIL PROTECTED] on 2003/03/08 20:16:36

        Add a B::COP::io() method, to return the cop_io field of COPs.
        Print it in B::Debug. Can be used later in B::Deparse to deparse
        the open pragma.

Affected files ...

... //depot/perl/ext/B/B.pm#50 edit
... //depot/perl/ext/B/B.xs#82 edit
... //depot/perl/ext/B/B/Debug.pm#20 edit

Differences ...

==== //depot/perl/ext/B/B.pm#50 (text) ====
Index: perl/ext/B/B.pm
--- perl/ext/B/B.pm#49~18220~   Sun Dec  1 16:58:54 2002
+++ perl/ext/B/B.pm     Sat Mar  8 12:16:36 2003
@@ -1042,6 +1042,8 @@
 
 =item stash
 
+=item stashpv
+
 =item file
 
 =item cop_seq
@@ -1049,6 +1051,10 @@
 =item arybase
 
 =item line
+
+=item warnings
+
+=item io
 
 =back
 

==== //depot/perl/ext/B/B.xs#82 (text) ====
Index: perl/ext/B/B.xs
--- perl/ext/B/B.xs#81~18737~   Mon Feb 17 16:47:00 2003
+++ perl/ext/B/B.xs     Sat Mar  8 12:16:36 2003
@@ -889,6 +889,7 @@
 #define COP_arybase(o) o->cop_arybase
 #define COP_line(o)    CopLINE(o)
 #define COP_warnings(o)        o->cop_warnings
+#define COP_io(o)      o->cop_io
 
 MODULE = B     PACKAGE = B::COP                PREFIX = COP_
 
@@ -922,6 +923,10 @@
 
 B::SV
 COP_warnings(o)
+       B::COP  o
+
+B::SV
+COP_io(o)
        B::COP  o
 
 MODULE = B     PACKAGE = B::SV         PREFIX = Sv

==== //depot/perl/ext/B/B/Debug.pm#20 (text) ====
Index: perl/ext/B/B/Debug.pm
--- perl/ext/B/B/Debug.pm#19~18298~     Thu Dec 12 12:00:36 2002
+++ perl/ext/B/B/Debug.pm       Sat Mar  8 12:16:36 2003
@@ -72,7 +72,8 @@
 sub B::COP::debug {
     my ($op) = @_;
     $op->B::OP::debug();
-    printf <<'EOT', $op->label, $op->stashpv, $op->file, $op->seq, $op->arybase, 
$op->line, ${$op->warnings};
+    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);
        cop_label       %s
        cop_stashpv     %s
        cop_file        %s
@@ -80,6 +81,7 @@
        cop_arybase     %d
        cop_line        %d
        cop_warnings    0x%x
+       cop_io          %s
 EOT
 }
 
End of Patch.

Reply via email to