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
commit3b176512ddb8b0471cb8603a2cb04053a05990a0 (patch)
treef15eae3195dc82bc17f456afd72ef1f8e6e88e8c /gdb/ppc-sysv-tdep.c
parente894887aa2555b213a485a688cb0fa61bb4f6346 (diff)
downloadgdb-3b176512ddb8b0471cb8603a2cb04053a05990a0.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