From: Rafael Garcia-Suarez Date: Sat, 8 Mar 2003 20:16:36 +0000 (+0000) Subject: Add a B::COP::io() method, to return the cop_io field of COPs. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6e6a1aefada3f56f44128d62c37dcbbe95fd2795;p=p5sagit%2Fp5-mst-13.2.git 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. p4raw-id: //depot/perl@18856 --- diff --git a/ext/B/B.pm b/ext/B/B.pm index f75e54b..ad53e9d 100644 --- a/ext/B/B.pm +++ b/ext/B/B.pm @@ -1042,6 +1042,8 @@ Only when perl was compiled with ithreads. =item stash +=item stashpv + =item file =item cop_seq @@ -1050,6 +1052,10 @@ Only when perl was compiled with ithreads. =item line +=item warnings + +=item io + =back diff --git a/ext/B/B.xs b/ext/B/B.xs index db7b8d3..595b928 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -889,6 +889,7 @@ LOOP_lastop(o) #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_ @@ -924,6 +925,10 @@ B::SV COP_warnings(o) B::COP o +B::SV +COP_io(o) + B::COP o + MODULE = B PACKAGE = B::SV PREFIX = Sv U32 diff --git a/ext/B/B/Debug.pm b/ext/B/B/Debug.pm index efc618e..1368bc8 100644 --- a/ext/B/B/Debug.pm +++ b/ext/B/B/Debug.pm @@ -72,7 +72,8 @@ sub B::PMOP::debug { 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 @@ sub B::COP::debug { cop_arybase %d cop_line %d cop_warnings 0x%x + cop_io %s EOT }