summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2003-01-19 17:22:05 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-01-22 13:05:27 +0000
commita3b4c9c6ae3d40704ff6ce94d7772e2cbe38eff6 (patch)
treec6bac839df041a808df0fbab9067b054c93ac0ce /dump.c
parent04ca4930675dbe212bae84041b9a725458ccf5b8 (diff)
downloadperl-a3b4c9c6ae3d40704ff6ce94d7772e2cbe38eff6.tar.gz
Re: slight tweak to -DR flag - display whether on tmps stack
Message-ID: <20030119172204.D24444@fdgroup.com> p4raw-id: //depot/perl@18558
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/dump.c b/dump.c
index 759906e2dd..8ca3e020db 100644
--- a/dump.c
+++ b/dump.c
@@ -194,11 +194,23 @@ Perl_sv_peek(pTHX_ SV *sv)
sv_catpv(t, "(");
unref++;
}
- else if (DEBUG_R_TEST_ && SvREFCNT(sv) > 1) {
- Perl_sv_catpvf(aTHX_ t, "<%"UVuf">", (UV)SvREFCNT(sv));
+ else if (DEBUG_R_TEST_) {
+ int is_tmp = 0;
+ I32 ix;
+ /* is this SV on the tmps stack? */
+ for (ix=PL_tmps_ix; ix>=0; ix--) {
+ if (PL_tmps_stack[ix] == sv) {
+ is_tmp = 1;
+ 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 (SvROK(sv)) {
sv_catpv(t, "\\");
if (SvCUR(t) + unref > 10) {