diff options
author | Mark Kettenis <kettenis@gnu.org> | 2001-12-29 19:38:16 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2001-12-29 19:38:16 +0000 |
commit | ec80a8ea8b066ab117939b77a6539f85de19b85f (patch) | |
tree | 0aefe429c9060b1a2a8aa33ce5af14933a315cd1 /gdb/i386-tdep.c | |
parent | 428721aaa3be621b3c63dc823dfbd993eb2bf942 (diff) | |
download | gdb-ec80a8ea8b066ab117939b77a6539f85de19b85f.zip gdb-ec80a8ea8b066ab117939b77a6539f85de19b85f.tar.gz gdb-ec80a8ea8b066ab117939b77a6539f85de19b85f.tar.bz2 |
* i386-tdep.c (i386_push_dummy_frame): Don't write back the
modified frame pointer until the old frame pointer has been saved.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 0a1472d..524a6ff 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -769,18 +769,20 @@ void i386_push_dummy_frame (void) { CORE_ADDR sp = read_register (SP_REGNUM); + CORE_ADDR fp; int regnum; char regbuf[MAX_REGISTER_RAW_SIZE]; sp = push_word (sp, read_register (PC_REGNUM)); sp = push_word (sp, read_register (FP_REGNUM)); - write_register (FP_REGNUM, sp); + fp = sp; for (regnum = 0; regnum < NUM_REGS; regnum++) { read_register_gen (regnum, regbuf); sp = push_bytes (sp, regbuf, REGISTER_RAW_SIZE (regnum)); } write_register (SP_REGNUM, sp); + write_register (FP_REGNUM, fp); } /* Insert the (relative) function address into the call sequence |