summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-10-28 22:06:33 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-10-28 22:06:33 -0700
commit67e04715435ea3cc1fa50557c6fba36c5344c884 (patch)
treed583161a042a70239990936581b787664f9eb9c2 /dump.c
parent3987a177937fb7957caa003cdf4c6dee1bb97f71 (diff)
downloadperl-67e04715435ea3cc1fa50557c6fba36c5344c884.tar.gz
Teach dump.c about ENAMEs
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/dump.c b/dump.c
index f7fc0147ec..a008911d37 100644
--- a/dump.c
+++ b/dump.c
@@ -1851,6 +1851,37 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
AV * const backrefs
= *Perl_hv_backreferences_p(aTHX_ MUTABLE_HV(sv));
struct mro_meta * const meta = HvAUX(sv)->xhv_mro_meta;
+ if (HvAUX(sv)->xhv_name_count)
+ Perl_dump_indent(aTHX_
+ level, file, " NAMECOUNT = \"%d\"\n",
+ HvAUX(sv)->xhv_name_count
+ );
+ if (HvAUX(sv)->xhv_name && HvENAME_HEK_NN(sv)) {
+ if (HvAUX(sv)->xhv_name_count) {
+ SV * const names = sv_newmortal();
+ HEK ** const namep = (HEK **)HvAUX(sv)->xhv_name;
+ const I32 count = HvAUX(sv)->xhv_name_count;
+ HEK **hekp = namep - (count > 0);
+ sv_setpv(names, "");
+ while (++hekp < namep + (count < 0 ? -count : count))
+ if (*hekp) {
+ sv_catpvs(names, ", \"");
+ sv_catpvn(
+ names, HEK_KEY(*hekp), HEK_LEN(*hekp)
+ );
+ sv_catpvs(names, "\"");
+ }
+ /* This should never happen. */
+ else sv_catpvs(names, ", (null)");
+ Perl_dump_indent(aTHX_
+ level, file, " ENAME = %s\n", SvPV_nolen(names)+2
+ );
+ }
+ else
+ Perl_dump_indent(aTHX_
+ level, file, " ENAME = \"%s\"\n", HvENAME_get(sv)
+ );
+ }
if (backrefs) {
Perl_dump_indent(aTHX_ level, file, " BACKREFS = 0x%"UVxf"\n",
PTR2UV(backrefs));