summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-04 05:51:14 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-04 05:51:14 +0000
commit83ee9e095f68fdbdc131f9a00306fb151d58abe2 (patch)
treef0460c4669eb8df6bd5bf9f2a5f9b5f8e4a4045c /ext
parentb48f1ba55530934180c410ecc1fb73c4bc730b30 (diff)
downloadperl-83ee9e095f68fdbdc131f9a00306fb151d58abe2.tar.gz
patch to provide more informative names for evals and anonymous
subroutines (from Ilya Zakharevich) p4raw-id: //depot/perl@4975
Diffstat (limited to 'ext')
-rw-r--r--ext/Devel/Peek/Peek.pm4
-rw-r--r--ext/Devel/Peek/Peek.xs10
2 files changed, 12 insertions, 2 deletions
diff --git a/ext/Devel/Peek/Peek.pm b/ext/Devel/Peek/Peek.pm
index 38251c6ee8..080251bb5e 100644
--- a/ext/Devel/Peek/Peek.pm
+++ b/ext/Devel/Peek/Peek.pm
@@ -4,14 +4,14 @@
package Devel::Peek;
# Underscore to allow older Perls to access older version from CPAN
-$VERSION = '1.00_00';
+$VERSION = '1.00_01';
require Exporter;
use XSLoader ();
@ISA = qw(Exporter);
@EXPORT = qw(Dump mstat DeadCode DumpArray DumpWithOP DumpProg);
-@EXPORT_OK = qw(SvREFCNT SvREFCNT_inc SvREFCNT_dec);
+@EXPORT_OK = qw(SvREFCNT SvREFCNT_inc SvREFCNT_dec CvGV);
%EXPORT_TAGS = ('ALL' => [@EXPORT, @EXPORT_OK]);
XSLoader::load 'Devel::Peek';
diff --git a/ext/Devel/Peek/Peek.xs b/ext/Devel/Peek/Peek.xs
index d2f66c40da..8af8847820 100644
--- a/ext/Devel/Peek/Peek.xs
+++ b/ext/Devel/Peek/Peek.xs
@@ -125,6 +125,10 @@ DeadCode(pTHX)
PerlIO_printf(Perl_debug_log, "%s: perl not compiled with DEBUGGING_MSTATS\n",str);
#endif
+#define _CvGV(cv) \
+ (SvROK(cv) && (SvTYPE(SvRV(cv))==SVt_PVCV) \
+ ? (SV*)CvGV((CV*)SvRV(cv)) : &PL_sv_undef)
+
MODULE = Devel::Peek PACKAGE = Devel::Peek
void
@@ -206,3 +210,9 @@ CODE:
RETVAL = DeadCode(aTHX);
OUTPUT:
RETVAL
+
+MODULE = Devel::Peek PACKAGE = Devel::Peek PREFIX = _
+
+SV *
+_CvGV(cv)
+ SV *cv