diff options
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index ce4c8a4..fd5969d 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -2332,6 +2332,22 @@ i386_16_byte_align_p (struct type *type) return 0; } +/* Implementation for set_gdbarch_push_dummy_code. */ + +static CORE_ADDR +i386_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, + struct value **args, int nargs, struct type *value_type, + CORE_ADDR *real_pc, CORE_ADDR *bp_addr, + struct regcache *regcache) +{ + /* Use 0xcc breakpoint - 1 byte. */ + *bp_addr = sp - 1; + *real_pc = funaddr; + + /* Keep the stack aligned. */ + return sp - 16; +} + static CORE_ADDR i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, @@ -7705,6 +7721,8 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_get_longjmp_target (gdbarch, i386_get_longjmp_target); /* Call dummy code. */ + set_gdbarch_call_dummy_location (gdbarch, ON_STACK); + set_gdbarch_push_dummy_code (gdbarch, i386_push_dummy_code); set_gdbarch_push_dummy_call (gdbarch, i386_push_dummy_call); set_gdbarch_frame_align (gdbarch, i386_frame_align); |