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] Treat struct frame_info as opaque in i386bsd-tdep.c


This probably fixes a bug too, since frame->next can point to an
invalid frame.

Checked in.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis at gnu dot org>
	* i386bsd-tdep.c (i386bsd_sigcontext_addr): Use get_next_frame and
	get_frame_base.

Index: i386bsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386bsd-tdep.c,v
retrieving revision 1.12
diff -u -p -r1.12 i386bsd-tdep.c
--- i386bsd-tdep.c 4 Jan 2003 23:38:45 -0000 1.12
+++ i386bsd-tdep.c 2 Mar 2003 17:04:15 -0000
@@ -50,11 +50,13 @@ i386bsd_pc_in_sigtramp (CORE_ADDR pc, ch
 CORE_ADDR
 i386bsd_sigcontext_addr (struct frame_info *frame)
 {
-  if (frame->next)
+  struct frame_info *next_frame = get_next_frame (frame);
+
+  if (next_frame)
     /* If this isn't the top frame, the next frame must be for the
        signal handler itself.  A pointer to the sigcontext structure
        is passed as the third argument to the signal handler.  */
-    return read_memory_unsigned_integer (frame->next->frame + 16, 4);
+    return read_memory_unsigned_integer (get_frame_base (next_frame) + 16, 4);
 
   /* This is the top frame.  We'll have to find the address of the
      sigcontext structure by looking at the stack pointer.  */


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