* m68k-tdep.c (m68k_reg_struct_return_p): Accept complex types.
authorAndreas Schwab <schwab@linux-m68k.org>
Tue, 24 Jul 2012 16:37:24 +0000 (16:37 +0000)
committerAndreas Schwab <schwab@linux-m68k.org>
Tue, 24 Jul 2012 16:37:24 +0000 (16:37 +0000)
(m68k_return_value): Handle complex types like structures.
(m68k_svr4_return_value): Likewise.

gdb/ChangeLog
gdb/m68k-tdep.c

index 2c0cac919a92229ac555a7da91580222929fb61d..39da5fe7f04e02262589cd4a11811575f4fef21a 100644 (file)
@@ -1,3 +1,9 @@
+2012-07-24  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * m68k-tdep.c (m68k_reg_struct_return_p): Accept complex types.
+       (m68k_return_value): Handle complex types like structures.
+       (m68k_svr4_return_value): Likewise.
+
 2012-07-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
 
        * gdb_bfd.c (zlib_decompress_section) <!HAVE_ZLIB_H>: Adjust
index b1e2cd4ace99d9e96e23171c7fca107a8239223e..b507c37865918adff85cc095988cf6757e282c57 100644 (file)
@@ -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:
This page took 0.032748 seconds and 4 git commands to generate.