summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2003-06-11 06:40:14 +0000
committerJim Blandy <jimb@codesourcery.com>2003-06-11 06:40:14 +0000
commit5bbf31deaf0a29df39bb171d304205e40b232d0e (patch)
treeed689be93c7b297911a44090038b30943b2e1dd0
parent9196bbd4bc2c10a929291137847f602b38a80f01 (diff)
downloadgdb-5bbf31deaf0a29df39bb171d304205e40b232d0e.tar.gz
* 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.
-rw-r--r--gdb/ChangeLog20
-rw-r--r--gdb/alpha-tdep.c9
-rw-r--r--gdb/arch-utils.c7
-rw-r--r--gdb/arch-utils.h4
-rw-r--r--gdb/cris-tdep.c15
-rw-r--r--gdb/frv-tdep.c14
-rw-r--r--gdb/h8300-tdep.c8
-rw-r--r--gdb/mips-tdep.c8
8 files changed, 36 insertions, 49 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b59ca9fbdcf..300502e4d12 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index ad7ca747507..6157fe3ebaf 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -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);
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 48f7f7ebe05..bdf370b0003 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -73,6 +73,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)
{
/* Only makes sense to supply raw registers. */
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index 27f219b0be9..733bb3e866d 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -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;
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 2fbfde53b0e..8ffb441c581 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -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);
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index c26af4d28ee..d50d0cfdfa8 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -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);
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 0559805da03..33db5641558 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -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);
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 23a5911f1c6..31410d66fc4 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -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);