summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2016-10-26 17:48:44 +0100
committerDavid Mitchell <davem@iabyn.com>2016-10-26 17:48:44 +0100
commitd5a163ad1974ba765cb85fdba390c24817141ec4 (patch)
tree352c158a82610f2f09d7b637ff8c0d6b2b58fd39 /dump.c
parentbe98855787c93fb16a7d4974601d4c8cf91ab8cb (diff)
downloadperl-d5a163ad1974ba765cb85fdba390c24817141ec4.tar.gz
-DsR : display unTEMPed temps with "t" not "T"
with the -R debugging flag, SVs are displayed with a reference count (if > 1), and with a T if the SV is referenced from the temps stack. E.g. $ perl -DstR -e'@a = map $_,"a", "b"' ... * <T>PV("a"\0) <T>PV("b"\0) This commit enhances this to use both "t" and "T": t: SV is referenced from PL_tmps_stack, but SvTEMP() not set T: SV is referenced from PL_tmps_stack, and in addition, SvTEMP() is set (The other permutation, SvTEMP() set but not in PL_tmps_stack, is illegal). This commit changes
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/dump.c b/dump.c
index d2d7f67a8c..3e1b011fc4 100644
--- a/dump.c
+++ b/dump.c
@@ -421,11 +421,14 @@ Perl_sv_peek(pTHX_ SV *sv)
break;
}
}
- if (SvREFCNT(sv) > 1)
- Perl_sv_catpvf(aTHX_ t, "<%"UVuf"%s>", (UV)SvREFCNT(sv),
- is_tmp ? "T" : "");
- else if (is_tmp)
- sv_catpv(t, "<T>");
+ if (is_tmp || SvREFCNT(sv) > 1) {
+ Perl_sv_catpvf(aTHX_ t, "<");
+ if (SvREFCNT(sv) > 1)
+ Perl_sv_catpvf(aTHX_ t, "%"UVuf, (UV)SvREFCNT(sv));
+ if (is_tmp)
+ Perl_sv_catpvf(aTHX_ t, "%s", SvTEMP(t) ? "T" : "t");
+ Perl_sv_catpvf(aTHX_ t, ">");
+ }
}
if (SvROK(sv)) {