* sh-tdep.c (sh_use_struct_convention): Use definition according to ABI.
authorCorinna Vinschen <corinna@vinschen.de>
Sat, 28 Sep 2002 16:11:29 +0000 (16:11 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Sat, 28 Sep 2002 16:11:29 +0000 (16:11 +0000)
(sh_push_arguments): Store in register with correct endianess.
(sh_default_store_return_value): Ditto.
(sh_gdbarch_init): Set sizeof long double to 8.

gdb/ChangeLog
gdb/sh-tdep.c

index 25e0981f424058e28d71ada2be3afef52de9344e..383ad64751f1cb6ebde3742704c0a7c68290fa09 100644 (file)
@@ -1,3 +1,10 @@
+2002-09-28  Corinna Vinschen  <vinschen@redhat.com>
+
+       * sh-tdep.c (sh_use_struct_convention): Use definition according to ABI.
+       (sh_push_arguments): Store in register with correct endianess.
+       (sh_default_store_return_value): Ditto.
+       (sh_gdbarch_init): Set sizeof long double to 8.
+
 2002-09-27  Mark Kettenis  <kettenis@gnu.org>
 
        * defs.h: Move inclusion of "ansidecl.h" before "gdb_locale.h".
index 7ac5b9ef57f3bc8924fc2a920cede5b5469cf234..c5e5bf457d2793daac229ad252e181807adf1f0f 100644 (file)
@@ -884,7 +884,14 @@ sh_saved_pc_after_call (struct frame_info *frame)
 static int
 sh_use_struct_convention (int gcc_p, struct type *type)
 {
+#if 0
   return (TYPE_LENGTH (type) > 1);
+#else
+  int len = TYPE_LENGTH (type);
+  int nelem = TYPE_NFIELDS (type);
+  return ((len != 1 && len != 2 && len != 4 && len != 8) || nelem != 1) &&
+         (len != 8 || TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0)) != 4);
+#endif
 }
 
 static int
@@ -2045,8 +2052,11 @@ sh_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
       if (len < 4)
        {
          /* value gets right-justified in the register or stack word */
-         memcpy (valbuf + (4 - len),
-                 (char *) VALUE_CONTENTS (args[argnum]), len);
+         if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+           memcpy (valbuf + (4 - len),
+                   (char *) VALUE_CONTENTS (args[argnum]), len);
+         else
+           memcpy (valbuf, (char *) VALUE_CONTENTS (args[argnum]), len);
          val = valbuf;
        }
       else
@@ -2457,8 +2467,11 @@ sh_default_store_return_value (struct type *type, char *valbuf)
     {
       /* Add leading zeros to the value. */
       memset (buf, 0, REGISTER_RAW_SIZE (R0_REGNUM));
-      memcpy (buf + REGISTER_RAW_SIZE (R0_REGNUM) - TYPE_LENGTH (type),
-             valbuf, TYPE_LENGTH (type));
+      if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+       memcpy (buf + REGISTER_RAW_SIZE (R0_REGNUM) - TYPE_LENGTH (type),
+               valbuf, TYPE_LENGTH (type));
+      else
+       memcpy (buf, valbuf, TYPE_LENGTH (type));
       write_register_bytes (REGISTER_BYTE (R0_REGNUM), buf, 
                            REGISTER_RAW_SIZE (R0_REGNUM));
     }
@@ -4544,7 +4557,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
   set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
   set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
-  set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT);/*??should be 8?*/
+  set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
 
   set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
   set_gdbarch_call_dummy_length (gdbarch, 0);
This page took 0.033041 seconds and 4 git commands to generate.