]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* arch-utils.c (always_use_struct_convention): New function.
authorJim Blandy <jimb@codesourcery.com>
Wed, 11 Jun 2003 06:40:14 +0000 (06:40 +0000)
committerJim Blandy <jimb@codesourcery.com>
Wed, 11 Jun 2003 06:40:14 +0000 (06:40 +0000)
* arch-utils.h (always_use_struct_convention): New prototype.
* alpha-tdep.c (alpha_use_struct_convention): Delete.
(alpha_gdbarch_init): Register always_use_struct_convention,
instead of alpha_use_struct_convention.
* cris-tdep.c (cris_use_struct_convention): Delete.
(cris_gdbarch_init): Register always_use_struct_convention,
instead of cris_use_struct_convention.
* frv-tdep.c (frv_use_struct_convention): Delete.
(frv_gdbarch_init): Register always_use_struct_convention,
instead of frv_use_struct_convention.
* h8300-tdep.c (h8300_use_struct_convention): Delete.
(h8300_gdbarch_init): Register always_use_struct_convention,
instead of h8300_use_struct_convention.
* mips_o32-tdep.c (mips_o32_use_struct_convention): Delete.
(mips_o32_gdbarch_init): Register always_use_struct_convention,
instead of mips_o32_use_struct_convention.

gdb/ChangeLog
gdb/alpha-tdep.c
gdb/arch-utils.c
gdb/arch-utils.h
gdb/cris-tdep.c
gdb/frv-tdep.c
gdb/h8300-tdep.c
gdb/mips-tdep.c

index b59ca9fbdcf874ce5f3f8515bdd0977d68bfab22..300502e4d12d48fc4b080649e941c9ca5774c6ec 100644 (file)
@@ -1,3 +1,23 @@
+2003-06-11  Jim Blandy  <jimb@redhat.com>
+
+       * arch-utils.c (always_use_struct_convention): New function.
+       * arch-utils.h (always_use_struct_convention): New prototype.
+       * alpha-tdep.c (alpha_use_struct_convention): Delete.
+       (alpha_gdbarch_init): Register always_use_struct_convention,
+       instead of alpha_use_struct_convention.
+       * cris-tdep.c (cris_use_struct_convention): Delete.
+       (cris_gdbarch_init): Register always_use_struct_convention,
+       instead of cris_use_struct_convention.
+       * frv-tdep.c (frv_use_struct_convention): Delete.
+       (frv_gdbarch_init): Register always_use_struct_convention,
+       instead of frv_use_struct_convention.
+       * h8300-tdep.c (h8300_use_struct_convention): Delete.
+       (h8300_gdbarch_init): Register always_use_struct_convention,
+       instead of h8300_use_struct_convention.
+       * mips_o32-tdep.c (mips_o32_use_struct_convention): Delete.
+       (mips_o32_gdbarch_init): Register always_use_struct_convention,
+       instead of mips_o32_use_struct_convention.
+
 2003-06-10  Jim Blandy  <jimb@redhat.com>
 
        * ppc-linux-tdep.c (ppc64_call_dummy_address): New function.
index ad7ca7475072d74f49d71d04d84801f5fa3c9ce3..6157fe3ebaf1037cdf7c498fbdb98baf27597239 100644 (file)
@@ -1600,13 +1600,6 @@ alpha_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
    matter.  */
 LONGEST alpha_call_dummy_words[] = { 0 };
 
-static int
-alpha_use_struct_convention (int gcc_p, struct type *type)
-{
-  /* Structures are returned by ref in extra arg0.  */
-  return 1;
-}
-
 static void
 alpha_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
 {
@@ -1842,7 +1835,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, alpha_frame_init_saved_regs);
 
-  set_gdbarch_use_struct_convention (gdbarch, alpha_use_struct_convention);
+  set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
   set_gdbarch_deprecated_extract_return_value (gdbarch, alpha_extract_return_value);
 
   set_gdbarch_deprecated_store_struct_return (gdbarch, alpha_store_struct_return);
index 48f7f7ebe05c2060596d8b5b19054d3b5749e623..bdf370b000378b93fe48bb424201d474c76a96a7 100644 (file)
@@ -72,6 +72,13 @@ legacy_store_return_value (struct type *type, struct regcache *regcache,
 }
 
 
+int
+always_use_struct_convention (int gcc_p, struct type *value_type)
+{
+  return 1;
+}
+
+
 int
 legacy_register_sim_regno (int regnum)
 {
index 27f219b0be990701f415c7a8a81cf4db4c15d4f7..733bb3e866d53dfddade2e1f05f84cbf43de7e99 100644 (file)
@@ -47,6 +47,10 @@ extern gdbarch_extract_return_value_ftype legacy_extract_return_value;
 /* Implementation of store return value that grubs the register cache.  */
 extern gdbarch_store_return_value_ftype legacy_store_return_value;
 
+/* To return any structure or union type by value, store it at the
+   address passed as an invisible first argument to the function.  */
+extern gdbarch_use_struct_convention_ftype always_use_struct_convention;
+
 /* Frameless functions not identifable. */
 extern gdbarch_frameless_function_invocation_ftype generic_frameless_function_invocation_not;
 
index 2fbfde53b0e3477d3e227475188c28bae3b6fc0d..8ffb441c581a410a81ce91caaf0e4c6af1e9838f 100644 (file)
@@ -1100,19 +1100,6 @@ cris_extract_struct_value_address (char *regbuf)
   return struct_return_address;
 }
 
-/* Returns 1 if a value of the given type being returned from a function 
-   must have space allocated for it on the stack.  gcc_p is true if the 
-   function being considered is known to have been compiled by GCC. 
-   In the CRIS ABI, structure return values are passed to the called 
-   function by reference in register R9 to a caller-allocated area, so
-   this is always true.  */
-
-int
-cris_use_struct_convention (int gcc_p, struct type *type)
-{
-  return 1;
-}
-
 /* Returns 1 if the given type will be passed by pointer rather than 
    directly.  */
 
@@ -4276,7 +4263,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_store_struct_return (gdbarch, cris_store_struct_return);
   set_gdbarch_deprecated_extract_struct_value_address
     (gdbarch, cris_extract_struct_value_address);
-  set_gdbarch_use_struct_convention (gdbarch, cris_use_struct_convention);
+  set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
 
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, cris_frame_init_saved_regs);
   set_gdbarch_deprecated_init_extra_frame_info (gdbarch, cris_init_extra_frame_info);
index c26af4d28eef3556946dced632adeb49928c7f12..d50d0cfdfa800d256c28179334cea9d26a0a2d78 100644 (file)
@@ -738,18 +738,6 @@ frv_frame_init_saved_regs (struct frame_info *frame)
   }
 }
 
-/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
-   EXTRACT_RETURN_VALUE?  GCC_P is true if compiled with gcc
-   and TYPE is the type (which is known to be struct, union or array).
-
-   The frv returns all structs in memory.  */
-
-static int
-frv_use_struct_convention (int gcc_p, struct type *type)
-{
-  return 1;
-}
-
 static void
 frv_extract_return_value (struct type *type, char *regbuf, char *valbuf)
 {
@@ -1080,7 +1068,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, frv_frame_init_saved_regs);
 
-  set_gdbarch_use_struct_convention (gdbarch, frv_use_struct_convention);
+  set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
   set_gdbarch_deprecated_extract_return_value (gdbarch, frv_extract_return_value);
 
   set_gdbarch_deprecated_store_struct_return (gdbarch, frv_store_struct_return);
index 0559805da037ce42a3b911a6f0b689a24f187398..33db564155845ec2de7aff6522adb9b4c3e83a6f 100644 (file)
@@ -1023,12 +1023,6 @@ h8300_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
   write_register (0, addr);
 }
 
-static int
-h8300_use_struct_convention (int gcc_p, struct type *type)
-{
-  return 1;
-}
-
 static CORE_ADDR
 h8300_extract_struct_value_address (char *regbuf)
 {
@@ -1155,7 +1149,7 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_store_struct_return (gdbarch, h8300_store_struct_return);
   set_gdbarch_deprecated_store_return_value (gdbarch, h8300_store_return_value);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, h8300_extract_struct_value_address);
-  set_gdbarch_use_struct_convention (gdbarch, h8300_use_struct_convention);
+  set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
   set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words);
   set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
   set_gdbarch_breakpoint_from_pc (gdbarch, h8300_breakpoint_from_pc);
index 23a5911f1c6111f927d797a6693fd2035b823d86..31410d66fc43cd282eafa0994af7c05d39514092 100644 (file)
@@ -750,12 +750,6 @@ mips_n32n64_use_struct_convention (int gcc_p, struct type *type)
   return (TYPE_LENGTH (type) > 2 * MIPS_SAVED_REGSIZE);
 }
 
-static 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? 
    For each architecture, structs are passed either by
    value or by reference, depending on their size.  */
@@ -5741,7 +5735,7 @@ mips_gdbarch_init (struct gdbarch_info info,
       set_gdbarch_reg_struct_has_addr (gdbarch, 
                                       mips_o32_reg_struct_has_addr);
       set_gdbarch_use_struct_convention (gdbarch, 
-                                        mips_o32_use_struct_convention);
+                                        always_use_struct_convention);
       break;
     case MIPS_ABI_O64:
       set_gdbarch_deprecated_push_arguments (gdbarch, mips_o64_push_arguments);