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/i386newframe] Fix QNX/Neutrino


Checked in.

Mark

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* i386-nto-tdep.c (i386nto_sigcontext_addr): Adapt for new frame
	unwinder.

Index: i386-nto-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-nto-tdep.c,v
retrieving revision 1.2.4.1
diff -u -p -r1.2.4.1 i386-nto-tdep.c
--- i386-nto-tdep.c 18 May 2003 09:44:12 -0000 1.2.4.1
+++ i386-nto-tdep.c 29 May 2003 10:19:37 -0000
@@ -231,14 +231,20 @@ i386nto_pc_in_sigtramp (CORE_ADDR pc, ch
   return name && strcmp ("__signalstub", name) == 0;
 }
 
-#define SIGCONTEXT_OFFSET 136
+#define I386_NTO_SIGCONTEXT_OFFSET 136
+
+/* Assuming NEXT_FRAME is a frame following a QNX Neutrino sigtramp
+   routine, return the address of the associated sigcontext structure.  */
+
 static CORE_ADDR
-i386nto_sigcontext_addr (struct frame_info *frame)
+i386nto_sigcontext_addr (struct frame_info *next_frame)
 {
-  if (get_next_frame (frame))
-    return get_frame_base (get_next_frame (frame)) + SIGCONTEXT_OFFSET;
+  char buf[4];
+
+  frame_unwind_register (next_frame, SP_REGNUM, buf);
+  sp = extract_unsigned_integer (buf, 4);
 
-  return read_register (SP_REGNUM) + SIGCONTEXT_OFFSET;
+  return sp + I386_NTO_SIGCONTEXT_OFFSET;
 }
 
 static void


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