summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-07-23 10:48:20 -0600
committerKarl Williamson <public@khwilliamson.com>2013-08-01 13:01:42 -0600
commitad3f05adb1975f100a1e610eaa5eb43099c3063d (patch)
tree96e569759c3c1ce62c0d9d9492620f97593085eb /dump.c
parent41c407bcf550c4e19a5b20e9ac26ad65a405d4e2 (diff)
downloadperl-ad3f05adb1975f100a1e610eaa5eb43099c3063d.tar.gz
Extend sv_dump() to dump SVt_INVLIST
This changes the previously unused _invlist_dump() function to be called from sv_dump() to dump inversion list scalars. The format for regular SVt_PVs doesn't give human-friendly output for these. Since these lists are currently not visible outside the Perl core, the format is documented only in comments in the function itself.
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/dump.c b/dump.c
index bbb045affd..333f225661 100644
--- a/dump.c
+++ b/dump.c
@@ -1682,12 +1682,19 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
pv_display(d, ptr - delta, delta, 0,
pvlim));
}
+ if (type == SVt_INVLIST) {
+ PerlIO_printf(file, "\n");
+ /* 4 blanks indents 2 beyond the PV, etc */
+ _invlist_dump(file, level, " ", sv);
+ }
+ else {
PerlIO_printf(file, "%s", pv_display(d, ptr, SvCUR(sv),
re ? 0 : SvLEN(sv),
pvlim));
if (SvUTF8(sv)) /* the 6? \x{....} */
PerlIO_printf(file, " [UTF8 \"%s\"]", sv_uni_display(d, sv, 6 * SvCUR(sv), UNI_DISPLAY_QQ));
PerlIO_printf(file, "\n");
+ }
Perl_dump_indent(aTHX_ level, file, " CUR = %"IVdf"\n", (IV)SvCUR(sv));
if (!re)
Perl_dump_indent(aTHX_ level, file, " LEN = %"IVdf"\n",