diff options
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 65a645a..b8fd0e5 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1605,6 +1605,17 @@ i386_register_reggroup_p (struct gdbarch *gdbarch, int regnum, } +/* Get the ith function argument for the current function. */ +CORE_ADDR +i386_fetch_pointer_argument (struct frame_info *frame, int argi, + struct type *type) +{ + CORE_ADDR stack; + frame_read_register (frame, SP_REGNUM, &stack); + return read_memory_unsigned_integer (stack + (4 * (argi + 1)), 4); +} + + static struct gdbarch * i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { @@ -1715,6 +1726,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) i386_add_reggroups (gdbarch); set_gdbarch_register_reggroup_p (gdbarch, i386_register_reggroup_p); + /* Helper for function argument information. */ + set_gdbarch_fetch_pointer_argument (gdbarch, i386_fetch_pointer_argument); + /* Hook in the DWARF CFI frame unwinder. */ frame_unwind_append_predicate (gdbarch, dwarf2_frame_p); set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info); |