logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

RFA: Fix i386-linux backtrace through signal handlers: msg#00601

Subject: RFA: Fix i386-linux backtrace through signal handlers
The patch to fix the testsuite problems in my last message.  The comment is
pretty self-explanatory; this is option "B" from our earlier conversation. 
If we appear to be in a function whose name includes "sigaction", use the PC
scanner instead of trusting the name.

OK?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2002-10-30  Daniel Jacobowitz  <drow@xxxxxxxxxx>

        * i386-linux-tdep.c (i386_linux_pc_in_sigtramp): Check for
        trampolines in sigaction.

Index: i386-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v
retrieving revision 1.17
diff -u -p -r1.17 i386-linux-tdep.c
--- i386-linux-tdep.c   12 Aug 2002 19:05:33 -0000      1.17
+++ i386-linux-tdep.c   30 Oct 2002 22:01:14 -0000
@@ -209,11 +209,17 @@ i386_linux_rt_sigtramp_start (CORE_ADDR 
 static int
 i386_linux_pc_in_sigtramp (CORE_ADDR pc, char *name)
 {
-  if (name)
-    return STREQ ("__restore", name) || STREQ ("__restore_rt", name);
-  
-  return (i386_linux_sigtramp_start (pc) != 0
-         || i386_linux_rt_sigtramp_start (pc) != 0);
+  /* If we have NAME, we can optimize the search.  The trampolines are
+     named __restore and __restore_rt.  However, they aren't dynamically
+     exported from the shared C library, so the trampoline may appear to
+     be part of the preceding function.  This should always be sigaction,
+     __sigaction, or __libc_sigaction (all aliases to the same function).  */
+  if (name == NULL || strstr (name, "sigaction") != NULL)
+    return (i386_linux_sigtramp_start (pc) != 0
+           || i386_linux_rt_sigtramp_start (pc) != 0);
+
+  return (strcmp ("__restore", name) == 0
+         || strcmp ("__restore_rt", name) == 0);
 }
 
 /* Assuming FRAME is for a GNU/Linux sigtramp routine, return the



<Prev in Thread] Current Thread [Next in Thread>