summaryrefslogtreecommitdiff
path: root/gdb/rs6000-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
commit98cdde3b4a783a09b9be0ab4d54f47303271029e (patch)
tree7fd1224c13fce8eb4f0ff6b35d6115ccef8ed006 /gdb/rs6000-tdep.c
parent4e03bbc1ad9a9bb6af033d9257c604aa20973b66 (diff)
downloadgdb-98cdde3b4a783a09b9be0ab4d54f47303271029e.tar.gz
* 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/rs6000-tdep.c')
-rw-r--r--gdb/rs6000-tdep.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 23fc0541e69..98e1a0ca088 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -230,6 +230,16 @@ rs6000_saved_pc_after_call (struct frame_info *fi)
return read_register (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum);
}
+/* Get the ith function argument for the current function. */
+CORE_ADDR
+rs6000_fetch_pointer_argument (struct frame_info *frame, int argi,
+ struct type *type)
+{
+ CORE_ADDR addr;
+ frame_read_register (frame, 3 + argi, &addr);
+ return addr;
+}
+
/* Calculate the destination of a branch/jump. Return -1 if not a branch. */
static CORE_ADDR
@@ -2991,6 +3001,9 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_locals_address (gdbarch, rs6000_frame_args_address);
set_gdbarch_deprecated_saved_pc_after_call (gdbarch, rs6000_saved_pc_after_call);
+ /* Helpers for function argument information. */
+ set_gdbarch_fetch_pointer_argument (gdbarch, rs6000_fetch_pointer_argument);
+
/* We can't tell how many args there are
now that the C compiler delays popping them. */
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);