Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: Fix i386-linux backtrace through signal handlers
@ 2002-10-30 14:06 Daniel Jacobowitz
  2002-10-31 11:12 ` Mark Kettenis
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Jacobowitz @ 2002-10-30 14:06 UTC (permalink / raw)
  To: gdb-patches; +Cc: kettenis

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@mvista.com>

	* 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RFA: Fix i386-linux backtrace through signal handlers
  2002-10-30 14:06 RFA: Fix i386-linux backtrace through signal handlers Daniel Jacobowitz
@ 2002-10-31 11:12 ` Mark Kettenis
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Kettenis @ 2002-10-31 11:12 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

   Date: Wed, 30 Oct 2002 17:06:54 -0500
   From: Daniel Jacobowitz <drow@mvista.com>

   2002-10-30  Daniel Jacobowitz  <drow@mvista.com>

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

Please check this in.  Thanks,

Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-31 19:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-30 14:06 RFA: Fix i386-linux backtrace through signal handlers Daniel Jacobowitz
2002-10-31 11:12 ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox