* 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-12 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-12 Andrew Cagney <cagney@redhat.com>
* wince.c: Include "mips-tdep.h".
}
}
-static int
-alpha_use_struct_convention (int gcc_p, struct type *type)
-{
- /* Structures are returned by ref in extra arg0. */
- return 1;
-}
-
\f
static const unsigned char *
alpha_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
set_gdbarch_frameless_function_invocation (gdbarch,
generic_frameless_function_invocation_not);
- set_gdbarch_use_struct_convention (gdbarch, alpha_use_struct_convention);
+ set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
set_gdbarch_extract_return_value (gdbarch, alpha_extract_return_value);
set_gdbarch_store_return_value (gdbarch, alpha_store_return_value);
set_gdbarch_extract_struct_value_address (gdbarch,
}
+int
+always_use_struct_convention (int gcc_p, struct type *value_type)
+{
+ return 1;
+}
+
+
int
legacy_register_sim_regno (int regnum)
{
/* 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;
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. */
-
-static 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. */
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);
}
}
-/* 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)
{
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);
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)
{
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);
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. */
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_push_dummy_call (gdbarch, mips_o64_push_dummy_call);