summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2001-04-16 13:03:15 +0000
committerMark Kettenis <kettenis@gnu.org>2001-04-16 13:03:15 +0000
commit45e7c406c77ccb0a24cebb3871fe5bfc728e12a0 (patch)
treecc852425b0abe788c6cebf0bf5d9e4ff030c0980 /gdb
parentf1979f053805380269e618fabca71d5aff2507af (diff)
downloadgdb-45e7c406c77ccb0a24cebb3871fe5bfc728e12a0.tar.gz
* i386-tdep.c (i386_frame_chain): New function.
* config/i386/tm-i386.h (FRAME_CHAIN): Redefine in terms of i386_frame_chain. (i386_frame_chain): New prototype.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/config/i386/tm-i386.h17
-rw-r--r--gdb/i386-tdep.c16
3 files changed, 29 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ee3364d4287..807aa0b7f8f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2001-04-16 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_frame_chain): New function.
+ * config/i386/tm-i386.h (FRAME_CHAIN): Redefine in terms of
+ i386_frame_chain.
+ (i386_frame_chain): New prototype.
+
2001-04-14 J.T. Conklin <jtc@redback.com>
* target.h (target_ops): Removed to_core_file_to_sym_file vector
diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/i386/tm-i386.h
index a7841b57ed5..83704413c05 100644
--- a/gdb/config/i386/tm-i386.h
+++ b/gdb/config/i386/tm-i386.h
@@ -323,17 +323,12 @@ extern CORE_ADDR i386_extract_struct_value_address (char *regbuf);
from the sigcontext structure which is pushed by the kernel on the
user stack, along with a pointer to it. */
-/* FRAME_CHAIN takes a frame's nominal address and produces the frame's
- chain-pointer.
- In the case of the i386, the frame's nominal address
- is the address of a 4-byte word containing the calling frame's address. */
-
-#define FRAME_CHAIN(thisframe) \
- ((thisframe)->signal_handler_caller \
- ? (thisframe)->frame \
- : (!inside_entry_file ((thisframe)->pc) \
- ? read_memory_unsigned_integer ((thisframe)->frame, 4) \
- : 0))
+/* Return the chain-pointer for FRAME. In the case of the i386, the
+ frame's nominal address is the address of a 4-byte word containing
+ the calling frame's address. */
+
+#define FRAME_CHAIN(frame) i386_frame_chain ((frame))
+extern CORE_ADDR i386_frame_chain (struct frame_info *frame);
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 49cc7966d7a..f654d6f3d51 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -349,6 +349,22 @@ i386_get_frame_setup (CORE_ADDR pc)
return (-1);
}
+/* Return the chain-pointer for FRAME. In the case of the i386, the
+ frame's nominal address is the address of a 4-byte word containing
+ the calling frame's address. */
+
+CORE_ADDR
+i386_frame_chain (struct frame_info *frame)
+{
+ if (frame->signal_handler_caller)
+ return frame->frame;
+
+ if (! inside_entry_file (frame->pc))
+ return read_memory_unsigned_integer (frame->frame, 4);
+
+ return 0;
+}
+
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */