* i386-tdep.c (i386_push_dummy_frame): Don't write back the

modified frame pointer until the old frame pointer has been saved.
This commit is contained in:
Mark Kettenis 2001-12-29 19:38:16 +00:00
parent 428721aaa3
commit ec80a8ea8b
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2001-12-29 Mark Kettenis <kettenis@gnu.org>
* 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 <ac131313@redhat.com>
* arch-utils.c (initialize_current_architecture): Test byte_order

View File

@ -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