summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-04-15 22:44:30 +0000
committerNicholas Clark <nick@ccl4.org>2006-04-15 22:44:30 +0000
commit9ba1f5657a950811acc3c9f990446c958b14c2a1 (patch)
tree1f3757e12b4069531045e770fde08f2336972d26 /dump.c
parent7d78471c63f10d04f55bbf9f835712005c358e03 (diff)
downloadperl-9ba1f5657a950811acc3c9f990446c958b14c2a1.tar.gz
Teach Perl_do_sv_dump how to cope with IOs that have bogus things in
GV slots. (Which source filters are prone to do to them). p4raw-id: //depot/perl@27827
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/dump.c b/dump.c
index c8406a1deb..70816627b9 100644
--- a/dump.c
+++ b/dump.c
@@ -1638,13 +1638,36 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
Perl_dump_indent(aTHX_ level, file, " LINES_LEFT = %"IVdf"\n", (IV)IoLINES_LEFT(sv));
if (IoTOP_NAME(sv))
Perl_dump_indent(aTHX_ level, file, " TOP_NAME = \"%s\"\n", IoTOP_NAME(sv));
- do_gv_dump (level, file, " TOP_GV", IoTOP_GV(sv));
+ if (!IoTOP_GV(sv) || SvTYPE(IoTOP_GV(sv)) == SVt_PVGV)
+ do_gv_dump (level, file, " TOP_GV", IoTOP_GV(sv));
+ else {
+ Perl_dump_indent(aTHX_ level, file, " TOP_GV = 0x%"UVxf"\n",
+ PTR2UV(IoTOP_GV(sv)));
+ do_sv_dump (level+1, file, (SV *) IoTOP_GV(sv), nest+1, maxnest,
+ dumpops, pvlim);
+ }
+ /* Source filters hide things that are not GVs in these three, so let's
+ be careful out there. */
if (IoFMT_NAME(sv))
Perl_dump_indent(aTHX_ level, file, " FMT_NAME = \"%s\"\n", IoFMT_NAME(sv));
- do_gv_dump (level, file, " FMT_GV", IoFMT_GV(sv));
+ if (!IoFMT_GV(sv) || SvTYPE(IoFMT_GV(sv)) == SVt_PVGV)
+ do_gv_dump (level, file, " FMT_GV", IoFMT_GV(sv));
+ else {
+ Perl_dump_indent(aTHX_ level, file, " FMT_GV = 0x%"UVxf"\n",
+ PTR2UV(IoFMT_GV(sv)));
+ do_sv_dump (level+1, file, (SV *) IoFMT_GV(sv), nest+1, maxnest,
+ dumpops, pvlim);
+ }
if (IoBOTTOM_NAME(sv))
Perl_dump_indent(aTHX_ level, file, " BOTTOM_NAME = \"%s\"\n", IoBOTTOM_NAME(sv));
- do_gv_dump (level, file, " BOTTOM_GV", IoBOTTOM_GV(sv));
+ if (!IoBOTTOM_GV(sv) || SvTYPE(IoBOTTOM_GV(sv)) == SVt_PVGV)
+ do_gv_dump (level, file, " BOTTOM_GV", IoBOTTOM_GV(sv));
+ else {
+ Perl_dump_indent(aTHX_ level, file, " BOTTOM_GV = 0x%"UVxf"\n",
+ PTR2UV(IoBOTTOM_GV(sv)));
+ do_sv_dump (level+1, file, (SV *) IoBOTTOM_GV(sv), nest+1, maxnest,
+ dumpops, pvlim);
+ }
Perl_dump_indent(aTHX_ level, file, " SUBPROCESS = %"IVdf"\n", (IV)IoSUBPROCESS(sv));
if (isPRINT(IoTYPE(sv)))
Perl_dump_indent(aTHX_ level, file, " TYPE = '%c'\n", IoTYPE(sv));