Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix OpenBSD signal trampoline recognition
@ 2004-07-23 13:43 Mark Kettenis
  2004-07-23 16:02 ` Andrew Cagney
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2004-07-23 13:43 UTC (permalink / raw)
  To: gdb-patches

Committed,

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>
 
	* sparc64obsd-tdep.c (sparc64obsd_pc_in_sigtramp): Adjust for
	changed signal trampoline in OpenBSD 3.5-current.

Index: sparc64obsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64obsd-tdep.c,v
retrieving revision 1.6
diff -u -p -r1.6 sparc64obsd-tdep.c
--- sparc64obsd-tdep.c 22 May 2004 15:16:22 -0000 1.6
+++ sparc64obsd-tdep.c 23 Jul 2004 13:42:26 -0000
@@ -83,17 +83,30 @@ sparc64obsd_pc_in_sigtramp (CORE_ADDR pc
 {
   CORE_ADDR start_pc = (pc & ~(sparc64obsd_page_size - 1));
   unsigned long insn;
+  int offset = 0;
 
   if (name)
     return 0;
 
+ retry:
   /* Check for "restore %g0, SYS_sigreturn, %g1".  */
-  insn = sparc_fetch_instruction (start_pc + 0xe8);
+  insn = sparc_fetch_instruction (start_pc + offset + 0xec);
   if (insn != 0x83e82067)
-    return 0;
+    {
+      if (offset == 0)
+	{
+	  /* In OpenBSD 3.5 and earlier releases, the code
+             implementing the sigreturn system call was at a different
+             offset within the signal trampoline.  Try again.  */
+	  offset = -4;
+	  goto retry;
+	}
+
+      return 0;
+    }
 
   /* Check for "t ST_SYSCALL".  */
-  insn = sparc_fetch_instruction (start_pc + 0xf0);
+  insn = sparc_fetch_instruction (start_pc + offset + 0xf4);
   if (insn != 0x91d02000)
     return 0;
 


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

end of thread, other threads:[~2004-07-30 22:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-23 13:43 [PATCH] Fix OpenBSD signal trampoline recognition Mark Kettenis
2004-07-23 16:02 ` Andrew Cagney
2004-07-30 22:45   ` Mark Kettenis

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