From: Dave Mitchell Date: Sun, 19 Jan 2003 17:22:05 +0000 (+0000) Subject: Re: slight tweak to -DR flag - display whether on tmps stack X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a3b4c9c6ae3d40704ff6ce94d7772e2cbe38eff6;p=p5sagit%2Fp5-mst-13.2.git Re: slight tweak to -DR flag - display whether on tmps stack Message-ID: <20030119172204.D24444@fdgroup.com> p4raw-id: //depot/perl@18558 --- diff --git a/dump.c b/dump.c index 759906e..8ca3e02 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, ""); } - if (SvROK(sv)) { sv_catpv(t, "\\"); if (SvCUR(t) + unref > 10) {