aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2000-06-12 01:44:35 +0000
committerMark Kettenis <kettenis@gnu.org>2000-06-12 01:44:35 +0000
commita7769679c2a5a2964860c20235de86dd5c5a0383 (patch)
tree8a439e87dbb2b55e650c2cc2c1b3cbbebebed2ea /gdb/i386-tdep.c
parent8ab863813992424472e316b4dd77fe75525f77e6 (diff)
downloadgdb-a7769679c2a5a2964860c20235de86dd5c5a0383.zip
gdb-a7769679c2a5a2964860c20235de86dd5c5a0383.tar.gz
gdb-a7769679c2a5a2964860c20235de86dd5c5a0383.tar.bz2
* config/i386/tm-i386.h: Add forward declaration of `struct value'.
(FIX_CALL_DUMMY): Redefined to call i386_fix_call_dummy. (i386_fix_call_dummy): Add prototype. * i386-tdep.c (i386_fix_call_dummy): New function based on the code from the old FIX_CALL_DUMMY macro.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 4eddde5..728d012 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -638,6 +638,26 @@ i386_push_dummy_frame ()
write_register (SP_REGNUM, sp);
}
+/* Insert the (relative) function address into the call sequence
+ stored at DYMMY. */
+
+void
+i386_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
+ value_ptr *args, struct type *type, int gcc_p)
+{
+ int from, to, delta, loc;
+
+ loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH);
+ from = loc + 5;
+ to = (int)(fun);
+ delta = to - from;
+
+ *((char *)(dummy) + 1) = (delta & 0xff);
+ *((char *)(dummy) + 2) = ((delta >> 8) & 0xff);
+ *((char *)(dummy) + 3) = ((delta >> 16) & 0xff);
+ *((char *)(dummy) + 4) = ((delta >> 24) & 0xff);
+}
+
void
i386_pop_frame ()
{