summaryrefslogtreecommitdiff
path: root/gdb/ppc-sysv-tdep.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2007-05-13 12:27:30 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2007-05-13 12:27:30 +0000
commitdb73a9e93faeed73ac859dbf679a2bbba6e4e064 (patch)
treee9a56d8799561f2eb25d52c11b65b3c5bf1d396d /gdb/ppc-sysv-tdep.c
parentda2c699c6f5e3e333615d4d6ffb5baf220927ba4 (diff)
downloadgdb-db73a9e93faeed73ac859dbf679a2bbba6e4e064.tar.gz
* inferior.h (read_sp): Remove prototype.
* regcache.c (read_sp): Remove. * gcore.c (derive_stack_segment): Use get_frame_sp instead of read_sp. * infcall.c (call_function_by_hand): Likewise. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Use regcache instead of calling read_sp. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise.
Diffstat (limited to 'gdb/ppc-sysv-tdep.c')
-rw-r--r--gdb/ppc-sysv-tdep.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index ca465e2e0ed..51f9c0a06ba 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -51,10 +51,12 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
int struct_return, CORE_ADDR struct_addr)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- const CORE_ADDR saved_sp = read_sp ();
+ ULONGEST saved_sp;
int argspace = 0; /* 0 is an initial wrong guess. */
int write_pass;
+ regcache_cooked_read_unsigned (regcache, SP_REGNUM, &saved_sp);
+
/* Go through the argument list twice.
Pass 1: Figure out how much new stack space is required for
@@ -578,10 +580,7 @@ ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
CORE_ADDR func_addr = find_function_addr (function, NULL);
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- /* By this stage in the proceedings, SP has been decremented by "red
- zone size" + "struct return size". Fetch the stack-pointer from
- before this and use that as the BACK_CHAIN. */
- const CORE_ADDR back_chain = read_sp ();
+ ULONGEST back_chain;
/* See for-loop comment below. */
int write_pass;
/* Size of the Altivec's vector parameter region, the final value is
@@ -599,6 +598,11 @@ ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
the possible values of tdep->wordsize. */
gdb_assert (tdep->wordsize == 8);
+ /* By this stage in the proceedings, SP has been decremented by "red
+ zone size" + "struct return size". Fetch the stack-pointer from
+ before this and use that as the BACK_CHAIN. */
+ regcache_cooked_read_unsigned (regcache, SP_REGNUM, &back_chain);
+
/* Go through the argument list twice.
Pass 1: Compute the function call's stack space and register