aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorAdam Fedor <fedor@gnu.org>2003-06-02 02:54:35 +0000
committerAdam Fedor <fedor@gnu.org>2003-06-02 02:54:35 +0000
commit143985b7f3c98d0644b2eef50059f14974fe9d64 (patch)
treef7be8c8c3c477f6a794f4f67885b1afe31c9418f /gdb/i386-tdep.c
parent7c0b4a206672ef45cc3112a1c3f5269e35f44efa (diff)
downloadgdb-143985b7f3c98d0644b2eef50059f14974fe9d64.zip
gdb-143985b7f3c98d0644b2eef50059f14974fe9d64.tar.gz
gdb-143985b7f3c98d0644b2eef50059f14974fe9d64.tar.bz2
* gdbarch.sh (function_list): Add FETCH_POINTER_ARGUMENT.
* gdbarch.[ch]: Regenerate. * hppa-tdep.c (hppa_fetch_pointer_argument): New function. (hppa_gdbarch_init): Set it in the gdbarch vector. * i386-tdep.c (i386_fetch_pointer_argument): New (i386_gdbarch_init): Set it into gdbarch. * rs6000-tdep.c (rs6000_fetch_pointer_argument): New. (rs6000_gdbarch_init): Set it in gdbarch. * sparc-tdep.c (sparc_fetch_pointer_argument): New (sparc_gdbarch_init): Set it in gdbarch.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c14
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);