From ec80a8ea8b066ab117939b77a6539f85de19b85f Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 29 Dec 2001 19:38:16 +0000 Subject: [PATCH] * i386-tdep.c (i386_push_dummy_frame): Don't write back the modified frame pointer until the old frame pointer has been saved. --- gdb/ChangeLog | 5 +++++ gdb/i386-tdep.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ccbdf43..5e6ed00 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2001-12-29 Mark Kettenis + + * i386-tdep.c (i386_push_dummy_frame): Don't write back the + modified frame pointer until the old frame pointer has been saved. + 2001-12-30 Andrew Cagney * arch-utils.c (initialize_current_architecture): Test byte_order 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 -- 2.7.4