This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix OpenBSD/i386 signal trampoline recognition


The signal trampoline has changed in OpenBSD 3.5-current.

Committed,

Mark

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

Index: i386obsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386obsd-tdep.c,v
retrieving revision 1.18
diff -u -p -r1.18 i386obsd-tdep.c
--- i386obsd-tdep.c 22 May 2004 15:16:22 -0000 1.18
+++ i386obsd-tdep.c 4 Aug 2004 21:04:59 -0000
@@ -78,15 +78,25 @@ i386obsd_sigtramp_p (struct frame_info *
   if (find_pc_section (pc) != NULL)
     return 0;
 
-  /* If we can't read the instructions at START_PC, return zero.  */
+  /* Allocate buffer.  */
   buf = alloca (sizeof sigreturn);
-  if (target_read_memory (start_pc + 0x14, buf, sizeof sigreturn))
+
+  /* If we can't read the instructions at START_PC, return zero.  */
+  if (target_read_memory (start_pc + 0x0a, buf, sizeof sigreturn))
     return 0;
 
   /* Check for sigreturn(2).  */
   if (memcmp (buf, sigreturn, sizeof sigreturn) == 0)
     return 1;
 
+  /* If we can't read the instructions at START_PC, return zero.  */
+  if (target_read_memory (start_pc + 0x14, buf, sizeof sigreturn))
+    return 0;
+
+  /* Check for sigreturn(2) (again).  */
+  if (memcmp (buf, sigreturn, sizeof sigreturn) == 0)
+    return 1;
+
   return 0;
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]