aboutsummaryrefslogtreecommitdiff
path: root/gdb/rs6000-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-09-09 22:21:36 +0000
committerAndrew Cagney <cagney@redhat.com>2003-09-09 22:21:36 +0000
commit794a477ae35a6044a569a6936b81bf2ba383b1b0 (patch)
tree64f8f2e2ae7c6215c7c05a307051992c13000aca /gdb/rs6000-tdep.c
parentc9263853b89401a8c592669ede96947711820b48 (diff)
downloadgdb-794a477ae35a6044a569a6936b81bf2ba383b1b0.zip
gdb-794a477ae35a6044a569a6936b81bf2ba383b1b0.tar.gz
gdb-794a477ae35a6044a569a6936b81bf2ba383b1b0.tar.bz2
2003-09-09 Andrew Cagney <cagney@redhat.com>
* rs6000-tdep.c (rs6000_fix_call_dummy): Delete function. (rs6000_push_dummy_call): Set the "TOC" register.
Diffstat (limited to 'gdb/rs6000-tdep.c')
-rw-r--r--gdb/rs6000-tdep.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index f3e3d8c..1fc2b2a 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1075,25 +1075,6 @@ rs6000_pop_frame (void)
flush_cached_frames ();
}
-/* Fixup the call sequence of a dummy function, with the real function
- address. Its arguments will be passed by gdb. */
-
-static void
-rs6000_fix_call_dummy (char *dummyname, CORE_ADDR pc, CORE_ADDR fun,
- int nargs, struct value **args, struct type *type,
- int gcc_p)
-{
- int ii;
- CORE_ADDR target_addr;
-
- if (rs6000_find_toc_address_hook != NULL)
- {
- CORE_ADDR tocvalue = (*rs6000_find_toc_address_hook) (fun);
- write_register (gdbarch_tdep (current_gdbarch)->ppc_toc_regnum,
- tocvalue);
- }
-}
-
/* All the ABI's require 16 byte alignment. */
static CORE_ADDR
rs6000_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
@@ -1321,6 +1302,14 @@ ran_out_of_registers_for_arguments:
store_unsigned_integer (tmp_buffer, 4, saved_sp);
write_memory (sp, tmp_buffer, 4);
+ /* Set the TOC register, get the value from the objfile reader
+ which, in turn, gets it from the VMAP table. */
+ if (rs6000_find_toc_address_hook != NULL)
+ {
+ CORE_ADDR tocvalue = (*rs6000_find_toc_address_hook) (func_addr);
+ regcache_raw_write_signed (regcache, tdep->ppc_toc_regnum, tocvalue);
+ }
+
target_store_registers (-1);
return sp;
}
@@ -2938,7 +2927,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_char_signed (gdbarch, 0);
- set_gdbarch_deprecated_fix_call_dummy (gdbarch, rs6000_fix_call_dummy);
set_gdbarch_frame_align (gdbarch, rs6000_frame_align);
if (sysv_abi && wordsize == 8)
/* PPC64 SYSV. */