2002-08-06 Michael Snyder <msnyder@redhat.com>
authorMichael Snyder <msnyder@vmware.com>
Thu, 8 Aug 2002 00:26:51 +0000 (00:26 +0000)
committerMichael Snyder <msnyder@vmware.com>
Thu, 8 Aug 2002 00:26:51 +0000 (00:26 +0000)
        * config/mips/tm-mips.h: Remove #define USE_STRUCT_CONVENTION.
* mips-tdep.c (mips_EABI_use_struct_convention,
mips_OABI_use_struct_convention, mips_NABI_use_struct_convention):
New functions.  (mips_use_struct_convention): Delete.
(mips_gdbarch_init): set use_gdbarch_convention.

gdb/ChangeLog
gdb/mips-tdep.c

index b028a0718acf5df505c813e69ec4fc7707dd883f..a82edc9ee00e7ce35e9074bb4be1bc44e0274404 100644 (file)
@@ -1,3 +1,11 @@
+2002-08-06  Michael Snyder  <msnyder@redhat.com>
+
+       * config/mips/tm-mips.h: Remove #define USE_STRUCT_CONVENTION.
+       * mips-tdep.c (mips_EABI_use_struct_convention, 
+       mips_OABI_use_struct_convention, mips_NABI_use_struct_convention):
+       New functions.  (mips_use_struct_convention): Delete.
+       (mips_gdbarch_init): set use_gdbarch_convention.
+
 2002-08-06  Michael Snyder  <msnyder@redhat.com>
 
        *  mips-tdep.c: gdbarch-ify reg_struct_has_addr.
index fc1bb148c0c21be41cac7f7f69d3c83983f626af..650998bab2bd799a04d5fb33f3c35c828deac7b7 100644 (file)
@@ -564,13 +564,23 @@ show_mask_address (char *cmd, int from_tty, struct cmd_list_element *c)
 }
 
 /* Should call_function allocate stack space for a struct return?  */
+
 int
-mips_use_struct_convention (int gcc_p, struct type *type)
+mips_eabi_use_struct_convention (int gcc_p, struct type *type)
 {
-  if (MIPS_EABI)
-    return (TYPE_LENGTH (type) > 2 * MIPS_SAVED_REGSIZE);
-  else
-    return 1;                  /* Structures are returned by ref in extra arg0 */
+  return (TYPE_LENGTH (type) > 2 * MIPS_SAVED_REGSIZE);
+}
+
+int
+mips_n32n64_use_struct_convention (int gcc_p, struct type *type)
+{
+  return 1;    /* Structures are returned by ref in extra arg0.  */
+}
+
+int
+mips_o32_use_struct_convention (int gcc_p, struct type *type)
+{
+  return 1;    /* Structures are returned by ref in extra arg0.  */
 }
 
 /* Should call_function pass struct by reference? 
@@ -4519,6 +4529,8 @@ mips_gdbarch_init (struct gdbarch_info info,
       set_gdbarch_long_long_bit (gdbarch, 64);
       set_gdbarch_reg_struct_has_addr (gdbarch, 
                                       mips_o32_reg_struct_has_addr);
+      set_gdbarch_use_struct_convention (gdbarch, 
+                                        mips_o32_use_struct_convention);
       break;
     case MIPS_ABI_O64:
       tdep->mips_default_saved_regsize = 8;
@@ -4534,6 +4546,8 @@ mips_gdbarch_init (struct gdbarch_info info,
       set_gdbarch_long_long_bit (gdbarch, 64);
       set_gdbarch_reg_struct_has_addr (gdbarch, 
                                       mips_o32_reg_struct_has_addr);
+      set_gdbarch_use_struct_convention (gdbarch, 
+                                        mips_o32_use_struct_convention);
       break;
     case MIPS_ABI_EABI32:
       tdep->mips_default_saved_regsize = 4;
@@ -4549,6 +4563,8 @@ mips_gdbarch_init (struct gdbarch_info info,
       set_gdbarch_long_long_bit (gdbarch, 64);
       set_gdbarch_reg_struct_has_addr (gdbarch, 
                                       mips_eabi_reg_struct_has_addr);
+      set_gdbarch_use_struct_convention (gdbarch, 
+                                        mips_eabi_use_struct_convention);
       break;
     case MIPS_ABI_EABI64:
       tdep->mips_default_saved_regsize = 8;
@@ -4564,6 +4580,8 @@ mips_gdbarch_init (struct gdbarch_info info,
       set_gdbarch_long_long_bit (gdbarch, 64);
       set_gdbarch_reg_struct_has_addr (gdbarch, 
                                       mips_eabi_reg_struct_has_addr);
+      set_gdbarch_use_struct_convention (gdbarch, 
+                                        mips_eabi_use_struct_convention);
       break;
     case MIPS_ABI_N32:
       tdep->mips_default_saved_regsize = 8;
@@ -4588,6 +4606,9 @@ mips_gdbarch_init (struct gdbarch_info info,
        tm_print_insn_info.mach = info.bfd_arch_info->mach;
       else
        tm_print_insn_info.mach = bfd_mach_mips8000;
+
+      set_gdbarch_use_struct_convention (gdbarch, 
+                                        mips_n32n64_use_struct_convention);
       set_gdbarch_reg_struct_has_addr (gdbarch, 
                                       mips_n32n64_reg_struct_has_addr);
       break;
@@ -4614,6 +4635,9 @@ mips_gdbarch_init (struct gdbarch_info info,
        tm_print_insn_info.mach = info.bfd_arch_info->mach;
       else
        tm_print_insn_info.mach = bfd_mach_mips8000;
+
+      set_gdbarch_use_struct_convention (gdbarch, 
+                                        mips_n32n64_use_struct_convention);
       set_gdbarch_reg_struct_has_addr (gdbarch, 
                                       mips_n32n64_reg_struct_has_addr);
       break;