diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2003-01-19 17:22:05 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-01-22 13:05:27 +0000 |
commit | a3b4c9c6ae3d40704ff6ce94d7772e2cbe38eff6 (patch) | |
tree | c6bac839df041a808df0fbab9067b054c93ac0ce /dump.c | |
parent | 04ca4930675dbe212bae84041b9a725458ccf5b8 (diff) | |
download | perl-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.c | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -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) { |