summaryrefslogtreecommitdiff
path: root/gdb/ppc-sysv-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-09-09 20:22:37 +0000
committerAndrew Cagney <cagney@redhat.com>2003-09-09 20:22:37 +0000
commit7a41266bbb4ac11fb6237b143556a02ef0020e18 (patch)
tree19a0687e2a7df4949eb41ee2df773767c94dbcfb /gdb/ppc-sysv-tdep.c
parent77b2b6d4605f755f1e0d67514be5d69e5f43ec72 (diff)
downloadbinutils-gdb-7a41266bbb4ac11fb6237b143556a02ef0020e18.tar.gz
2003-09-09 Andrew Cagney <cagney@redhat.com>
* rs6000-tdep.c (rs6000_store_struct_return): Delete function. (rs6000_push_dummy_call): Store the struct return address. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Ditto.
Diffstat (limited to 'gdb/ppc-sysv-tdep.c')
-rw-r--r--gdb/ppc-sysv-tdep.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index 24376b9cec6..bd801881837 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -69,12 +69,23 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
CORE_ADDR saved_sp;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- greg = struct_return ? 4 : 3;
+ greg = 3;
freg = 1;
vreg = 2;
argstkspace = 0;
structstkspace = 0;
+ /* If the function is returning a `struct', then the first word
+ (which will be passed in r3) is used for struct return address.
+ In that case we should advance one word and start from r4
+ register to copy parameters. */
+ if (struct_return)
+ {
+ regcache_raw_write_signed (regcache, tdep->ppc_gp0_regnum + greg,
+ struct_addr);
+ greg++;
+ }
+
/* Figure out how much new stack space is required for arguments
which don't fit in registers. Unlike the PowerOpen ABI, the
SysV ABI doesn't reserve any extra space for parameters which