aboutsummaryrefslogtreecommitdiff
path: root/gdb/m68k-tdep.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2012-07-24 16:37:24 +0000
committerAndreas Schwab <schwab@linux-m68k.org>2012-07-24 16:37:24 +0000
commit108fb0f719bbf3f627d6ff34ba0f26b67aa971b5 (patch)
treef00acd8cd5d27370df23624ff499c04bf14e8e7d /gdb/m68k-tdep.c
parent554adb2c663c4988674ef77f0dae4dfa2efee25a (diff)
downloadgdb-108fb0f719bbf3f627d6ff34ba0f26b67aa971b5.zip
gdb-108fb0f719bbf3f627d6ff34ba0f26b67aa971b5.tar.gz
gdb-108fb0f719bbf3f627d6ff34ba0f26b67aa971b5.tar.bz2
* m68k-tdep.c (m68k_reg_struct_return_p): Accept complex types.
(m68k_return_value): Handle complex types like structures. (m68k_svr4_return_value): Likewise.
Diffstat (limited to 'gdb/m68k-tdep.c')
-rw-r--r--gdb/m68k-tdep.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index b1e2cd4..b507c37 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -377,8 +377,8 @@ m68k_svr4_store_return_value (struct type *type, struct regcache *regcache,
m68k_store_return_value (type, regcache, valbuf);
}
-/* Return non-zero if TYPE, which is assumed to be a structure or
- union type, should be returned in registers for architecture
+/* Return non-zero if TYPE, which is assumed to be a structure, union or
+ complex type, should be returned in registers for architecture
GDBARCH. */
static int
@@ -388,7 +388,8 @@ m68k_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type)
enum type_code code = TYPE_CODE (type);
int len = TYPE_LENGTH (type);
- gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION);
+ gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION
+ || code == TYPE_CODE_COMPLEX);
if (tdep->struct_return == pcc_struct_return)
return 0;
@@ -410,7 +411,8 @@ m68k_return_value (struct gdbarch *gdbarch, struct value *function,
enum type_code code = TYPE_CODE (type);
/* GCC returns a `long double' in memory too. */
- if (((code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION)
+ if (((code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION
+ || code == TYPE_CODE_COMPLEX)
&& !m68k_reg_struct_return_p (gdbarch, type))
|| (code == TYPE_CODE_FLT && TYPE_LENGTH (type) == 12))
{
@@ -444,7 +446,8 @@ m68k_svr4_return_value (struct gdbarch *gdbarch, struct value *function,
{
enum type_code code = TYPE_CODE (type);
- if ((code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION)
+ if ((code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION
+ || code == TYPE_CODE_COMPLEX)
&& !m68k_reg_struct_return_p (gdbarch, type))
{
/* The System V ABI says that: