include sv_debug_serial field in debugging output
David Mitchell [Fri, 8 Jan 2010 17:53:29 +0000 (17:53 +0000)]
dump.c
perl.c

diff --git a/dump.c b/dump.c
index 54999ad..bc1ba58 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -1566,12 +1566,15 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
     s = SvPVX_const(d);
 
 #ifdef DEBUG_LEAKING_SCALARS
-    Perl_dump_indent(aTHX_ level, file, "ALLOCATED at %s:%d %s %s%s\n",
+    Perl_dump_indent(aTHX_ level, file,
+       "ALLOCATED at %s:%d %s %s%s; serial %"UVuf"\n",
        sv->sv_debug_file ? sv->sv_debug_file : "(unknown)",
        sv->sv_debug_line,
        sv->sv_debug_inpad ? "for" : "by",
        sv->sv_debug_optype ? PL_op_name[sv->sv_debug_optype]: "(none)",
-       sv->sv_debug_cloned ? " (cloned)" : "");
+       sv->sv_debug_cloned ? " (cloned)" : "",
+       sv->sv_debug_serial
+    );
 #endif
     Perl_dump_indent(aTHX_ level, file, "SV = ");
     if (type < SVt_LAST) {
diff --git a/perl.c b/perl.c
index 83ef30e..f44fab7 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -1162,7 +1162,7 @@ perl_destruct(pTHXx)
                    PerlIO_printf(Perl_debug_log, "leaked: sv=0x%p"
                        " flags=0x%"UVxf
                        " refcnt=%"UVuf pTHX__FORMAT "\n"
-                       "\tallocated at %s:%d %s %s%s\n",
+                       "\tallocated at %s:%d %s %s%s; serial %"UVuf"\n",
                        (void*)sv, (UV)sv->sv_flags, (UV)sv->sv_refcnt
                        pTHX__VALUE,
                        sv->sv_debug_file ? sv->sv_debug_file : "(unknown)",
@@ -1170,7 +1170,8 @@ perl_destruct(pTHXx)
                        sv->sv_debug_inpad ? "for" : "by",
                        sv->sv_debug_optype ?
                            PL_op_name[sv->sv_debug_optype]: "(none)",
-                       sv->sv_debug_cloned ? " (cloned)" : ""
+                       sv->sv_debug_cloned ? " (cloned)" : "",
+                       sv->sv_debug_serial
                    );
 #ifdef DEBUG_LEAKING_SCALARS_FORK_DUMP
                    Perl_dump_sv_child(aTHX_ sv);