aboutsummaryrefslogtreecommitdiff
path: root/gdb/ppcnbsd-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-11-07 20:44:51 +0000
committerAndrew Cagney <cagney@redhat.com>2003-11-07 20:44:51 +0000
commit05580c65ad432b4dfab9283a4573bc812835375a (patch)
treecf8b788c6b4d6bd213869c8c5118577a4c3992a3 /gdb/ppcnbsd-tdep.c
parente2a2ebaad5af00b39ccc1af2e5e27cb08fbe7e8f (diff)
downloadgdb-05580c65ad432b4dfab9283a4573bc812835375a.zip
gdb-05580c65ad432b4dfab9283a4573bc812835375a.tar.gz
gdb-05580c65ad432b4dfab9283a4573bc812835375a.tar.bz2
2003-11-07 Andrew Cagney <cagney@redhat.com>
* ppc-linux-tdep.c (ppc_linux_init_abi): When 32-bit GNU/Linux, set "return_value" instead of "use_struct_convention". (ppc_linux_use_struct_convention): Delete function. (ppc_linux_return_value): New function. * ppc-sysv-tdep.c (ppc_sysv_abi_return_value): New function. (ppc_sysv_abi_broken_return_value): New function. (do_ppc_sysv_return_value): Add "gdbarch" parameter. (ppc64_sysv_abi_push_dummy_call): Add "gdbarch" parameter, drop static. (ppc_sysv_abi_extract_return_value): Delete function. (ppc_sysv_abi_broken_extract_return_value): Delete function. (ppc_sysv_abi_store_return_value): Delete function. (ppc_sysv_abi_broken_store_return_value): Delete function. (ppc_sysv_abi_use_struct_convention): Delete function. (ppc64_sysv_abi_use_struct_convention): Delete function. (ppc64_sysv_abi_extract_return_value): Delete function. (ppc64_sysv_abi_store_return_value): Delete function. * ppcnbsd-tdep.c (ppcnbsd_return_value): New function. (ppcnbsd_init_abi): Set "return_value", instead of "use_struct_convention", "extract_return_value", and "store_return_value". (ppcnbsd_use_struct_convention): Delete function. * ppc-tdep.h (ppc64_sysv_abi_return_value): Declare. (ppc_sysv_abi_return_value): Declare. (ppc_sysv_abi_broken_return_value): Declare. (ppc_sysv_abi_use_struct_convention): Delete. (ppc_sysv_abi_store_return_value): Delete. (ppc_sysv_abi_extract_return_value): Delete. (ppc_sysv_abi_broken_store_return_value): Delete. (ppc_sysv_abi_broken_extract_return_value): Delete. (ppc64_sysv_abi_use_struct_convention): Delete. (ppc64_sysv_abi_extract_return_value): Delete. (ppc64_sysv_abi_store_return_value): Delete. * rs6000-tdep.c (rs6000_gdbarch_init): For 32-bit and 64-bit SYSV, set "return_value" instead of "extract_return_value", "store_return_value", and "use_struct_convention".
Diffstat (limited to 'gdb/ppcnbsd-tdep.c')
-rw-r--r--gdb/ppcnbsd-tdep.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/gdb/ppcnbsd-tdep.c b/gdb/ppcnbsd-tdep.c
index b566f30..ab535c4 100644
--- a/gdb/ppcnbsd-tdep.c
+++ b/gdb/ppcnbsd-tdep.c
@@ -208,17 +208,22 @@ ppcnbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
convention but, 1.6 switched to the below broken convention. For
the moment use the broken convention. Ulgh!. */
-static int
-ppcnbsd_use_struct_convention (int gcc_p, struct type *value_type)
-{
- if ((TYPE_LENGTH (value_type) == 16 || TYPE_LENGTH (value_type) == 8)
- && TYPE_VECTOR (value_type))
- return 0;
-
- return !(TYPE_LENGTH (value_type) == 1
- || TYPE_LENGTH (value_type) == 2
- || TYPE_LENGTH (value_type) == 4
- || TYPE_LENGTH (value_type) == 8);
+static enum return_value_convention
+ppcnbsd_return_value (struct gdbarch *gdbarch, struct type *valtype,
+ struct regcache *regcache, const void *inval, void *outval)
+{
+ if ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT
+ || TYPE_CODE (valtype) == TYPE_CODE_UNION)
+ && !((TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 8)
+ && TYPE_VECTOR (valtype))
+ && !(TYPE_LENGTH (valtype) == 1
+ || TYPE_LENGTH (valtype) == 2
+ || TYPE_LENGTH (valtype) == 4
+ || TYPE_LENGTH (valtype) == 8))
+ return RETURN_VALUE_STRUCT_CONVENTION;
+ else
+ return ppc_sysv_abi_broken_return_value (gdbarch, valtype, regcache,
+ inval, outval);
}
static void
@@ -228,9 +233,7 @@ ppcnbsd_init_abi (struct gdbarch_info info,
set_gdbarch_pc_in_sigtramp (gdbarch, ppcnbsd_pc_in_sigtramp);
/* For NetBSD, this is an on again, off again thing. Some systems
do use the broken struct convention, and some don't. */
- set_gdbarch_use_struct_convention (gdbarch, ppcnbsd_use_struct_convention);
- set_gdbarch_extract_return_value (gdbarch, ppc_sysv_abi_broken_extract_return_value);
- set_gdbarch_store_return_value (gdbarch, ppc_sysv_abi_broken_store_return_value);
+ set_gdbarch_return_value (gdbarch, ppcnbsd_return_value);
set_solib_svr4_fetch_link_map_offsets (gdbarch,
nbsd_ilp32_solib_svr4_fetch_link_map_offsets);
}