aboutsummaryrefslogtreecommitdiff
path: root/gdb/rs6000-tdep.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-02-21 13:49:17 -0700
committerTom Tromey <tromey@adacore.com>2023-04-21 07:14:24 -0600
commitfbdecfbf285234cd4eba0e7daf480c63b2d65eb3 (patch)
tree6d2957e6736f42e49332474bc95d7177d9bbfc18 /gdb/rs6000-tdep.c
parent9df25c346f5517c0228d067c68ee2f6bfe1728ad (diff)
downloadbinutils-fbdecfbf285234cd4eba0e7daf480c63b2d65eb3.zip
binutils-fbdecfbf285234cd4eba0e7daf480c63b2d65eb3.tar.gz
binutils-fbdecfbf285234cd4eba0e7daf480c63b2d65eb3.tar.bz2
Use entry values for 32-bit PPC struct return
AdaCore has a local patch for PPC "finish", but last year, Ulrich Weigand pointed out that this patch was incorrect. It may work for simple functions like the one in the internal test, but nothing guarantees that r3 will be preserved by the callee, so checking r3 on exit is not always correct. This patch fixes the problem using the same approach as PPC64: use the entry value of r3, if available. Ulrich confirmed this matches the PPC32 ABI.
Diffstat (limited to 'gdb/rs6000-tdep.c')
-rw-r--r--gdb/rs6000-tdep.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index ee18b49..966b75b 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -8273,12 +8273,11 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
if (wordsize == 8)
{
set_gdbarch_return_value (gdbarch, ppc64_sysv_abi_return_value);
- set_gdbarch_get_return_buf_addr (gdbarch,
- ppc64_sysv_get_return_buf_addr);
set_gdbarch_update_call_site_pc (gdbarch, ppc64_update_call_site_pc);
}
else
set_gdbarch_return_value (gdbarch, ppc_sysv_abi_return_value);
+ set_gdbarch_get_return_buf_addr (gdbarch, ppc_sysv_get_return_buf_addr);
/* Set lr_frame_offset. */
if (wordsize == 8)