]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
VG_(apply_StackTrace): following r8818, we should regard an entry of -1
authorJulian Seward <jseward@acm.org>
Sat, 24 Jan 2009 00:07:53 +0000 (00:07 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 24 Jan 2009 00:07:53 +0000 (00:07 +0000)
as denoting the logical end of the stack.  This change stops printing
of a lot of junk below the logical "-1" end mark.  See added comments
for details.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9051

coregrind/m_stacktrace.c

index bd1e42a6cf8f2252330d150b967b24b408a44e54..687d2062f5dcc273a25902d10cdef1176023a19a 100644 (file)
@@ -561,7 +561,13 @@ void VG_(apply_StackTrace)( void(*action)(UInt n, Addr ip),
       action(i, ip);
 
       i++;
-   } while (i < n_ips && ips[i] != 0 && !main_done);
+      // re 'while' condition: stop if we hit a zero value (the traditional
+      // end-of-stack marker) or a ~0 value.  The latter because r8818 
+      // (in this file) changes the meaning of entries [1] and above in a
+      // stack trace, by subtracting 1 from them.  Hence stacks that used
+      // to end with a zero value now end in -1 and so we must detect
+      // that too.
+   } while (i < n_ips && ips[i] != 0 && ips[i] != ~(Addr)0 && !main_done);
 
    #undef MYBUF_LEN
 }