]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
ppc64-linux: apply the bogus-LR kludge in a second place.
authorJulian Seward <jseward@acm.org>
Thu, 19 Jan 2006 03:47:30 +0000 (03:47 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 19 Jan 2006 03:47:30 +0000 (03:47 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5555

coregrind/m_stacktrace.c

index 8f4877cf2782e11b3c016c759601084d58b74fb0..ce0b3facaa995c85964fbdbbd7b50b4cf1f34550 100644 (file)
@@ -240,6 +240,19 @@ UInt VG_(get_StackTrace2) ( ThreadId tid_if_known,
    /* fp is %r1.  ip is %cia.  Note, ppc uses r1 as both the stack and
       frame pointers. */
 
+#  if defined(VGP_ppc64_linux)
+   /* Deal with bogus LR values caused by function
+      interception/wrapping; see comment on similar code a few lines
+      further down. */
+   if (lr == (Addr)&VG_(ppc64_linux_magic_redirect_return_stub)
+       && VG_(is_valid_tid)(tid_if_known)) {
+      Long hsp = VG_(threads)[tid_if_known].arch.vex.guest_REDIR_SP;
+      if (hsp >= 1 && hsp < VEX_GUEST_PPC64_REDIR_STACK_SIZE)
+         lr = VG_(threads)[tid_if_known]
+                 .arch.vex.guest_REDIR_STACK[hsp-1];
+   }
+#  endif
+
    lr_is_first_RA = False;
    {
 #     define M_VG_ERRTXT 1000