This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Use frame methods in i386 build
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 08 Jan 2003 17:46:36 -0500
- Subject: [commit] Use frame methods in i386 build
Hello,
The attached fixes a few stray frame->pc, frame->frame and frame->next
uses found when building i386 GNU/Linux native.
committed,
Andrew
2003-01-08 Andrew Cagney <cagney@redhat.com>
* gcore.c, i386-linux-tdep.c: Use get_frame_pc, get_next_frame and
get_frame_base.
Index: gcore.c
===================================================================
RCS file: /cvs/src/src/gdb/gcore.c,v
retrieving revision 1.7
diff -u -r1.7 gcore.c
--- gcore.c 8 Aug 2002 14:59:35 -0000 1.7
+++ gcore.c 8 Jan 2003 21:53:44 -0000
@@ -179,7 +179,7 @@
return 0; /* Can't succeed without current frame. */
/* Save frame pointer of TOS frame. */
- *top = fi->frame;
+ *top = get_frame_base (fi);
/* If current stack pointer is more "inner", use that instead. */
if (INNER_THAN (read_sp (), *top))
*top = read_sp ();
@@ -189,7 +189,7 @@
fi = tmp_fi;
/* Save frame pointer of prev-most frame. */
- *bottom = fi->frame;
+ *bottom = get_frame_base (fi);
/* Now canonicalize their order, so that 'bottom' is a lower address
(as opposed to a lower stack frame). */
Index: i386-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v
retrieving revision 1.21
diff -u -r1.21 i386-linux-tdep.c
--- i386-linux-tdep.c 4 Jan 2003 23:38:45 -0000 1.21
+++ i386-linux-tdep.c 8 Jan 2003 21:53:45 -0000
@@ -247,16 +247,16 @@
{
CORE_ADDR pc;
- pc = i386_linux_sigtramp_start (frame->pc);
+ pc = i386_linux_sigtramp_start (get_frame_pc (frame));
if (pc)
{
CORE_ADDR sp;
- if (frame->next)
+ if (get_next_frame (frame))
/* If this isn't the top frame, the next frame must be for the
signal handler itself. The sigcontext structure lives on
the stack, right after the signum argument. */
- return frame->next->frame + 12;
+ return get_frame_base (get_next_frame (frame)) + 12;
/* This is the top frame. We'll have to find the address of the
sigcontext structure by looking at the stack pointer. Keep
@@ -264,20 +264,21 @@
"pop %eax". If the PC is at this instruction, adjust the
returned value accordingly. */
sp = read_register (SP_REGNUM);
- if (pc == frame->pc)
+ if (pc == get_frame_pc (frame))
return sp + 4;
return sp;
}
- pc = i386_linux_rt_sigtramp_start (frame->pc);
+ pc = i386_linux_rt_sigtramp_start (get_frame_pc (frame));
if (pc)
{
- if (frame->next)
+ if (get_next_frame (frame))
/* If this isn't the top frame, the next frame must be for the
signal handler itself. The sigcontext structure is part of
the user context. A pointer to the user context is passed
as the third argument to the signal handler. */
- return read_memory_integer (frame->next->frame + 16, 4) + 20;
+ return read_memory_integer (get_frame_base (get_next_frame (frame))
+ + 16, 4) + 20;
/* This is the top frame. Again, use the stack pointer to find
the address of the sigcontext structure. */