aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.h
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-01-26 20:52:13 +0000
committerAndrew Cagney <cagney@redhat.com>2004-01-26 20:52:13 +0000
commit74055713e6ea65185ee25cd49cb7b4e720a81ec3 (patch)
tree2f925e3e8398233e68ae36361a338f4744c2a301 /gdb/gdbarch.h
parenta67af2b9de8208a715df12a4fa4da0d05c08570e (diff)
downloadgdb-74055713e6ea65185ee25cd49cb7b4e720a81ec3.zip
gdb-74055713e6ea65185ee25cd49cb7b4e720a81ec3.tar.gz
gdb-74055713e6ea65185ee25cd49cb7b4e720a81ec3.tar.bz2
2004-01-26 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (EXTRACT_STRUCT_VALUE_ADDRESS): Deprecate. Add comments mentioning extract_returned_value_address. * infcmd.c (print_return_value): Update. Add comments on extract_returned_value_address. * stack.c (return_command): Add comments on extract_returned_value_address. * values.c: Update comment. * m32r-tdep.c: Update comment. * sparc-tdep.c: Update comment. * ia64-tdep.c (ia64_use_struct_convention): Update comment. * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. * sh64-tdep.c (sh64_gdbarch_init): Update. * sh-tdep.c (sh_gdbarch_init): Update. * s390-tdep.c (s390_gdbarch_init): Update. * rs6000-tdep.c (rs6000_gdbarch_init): Update. * m68klinux-tdep.c (m68k_linux_init_abi): Update. * m68k-tdep.c (m68k_gdbarch_init): Update. * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. * m32r-tdep.c (m32r_gdbarch_init): Update. * ia64-tdep.c (ia64_gdbarch_init): Update. * h8300-tdep.c (h8300_gdbarch_init): Update. * frv-tdep.c (frv_gdbarch_init): Update. * arm-tdep.c (arm_gdbarch_init): Update. * alpha-tdep.c (alpha_gdbarch_init): Update. Index: doc/ChangeLog 2004-01-26 Andrew Cagney <cagney@redhat.com> * gdbint.texinfo (Target Architecture Definition): Rename EXTRACT_STRUCT_VALUE_ADDRESS to DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS.
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r--gdb/gdbarch.h56
1 files changed, 35 insertions, 21 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 8240ae4..e6651c7 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1447,11 +1447,7 @@ extern void set_gdbarch_return_value (struct gdbarch *gdbarch, gdbarch_return_va
/* The deprecated methods RETURN_VALUE_ON_STACK, EXTRACT_RETURN_VALUE,
STORE_RETURN_VALUE and USE_STRUCT_CONVENTION have all been folded
- into RETURN_VALUE. For the moment do not try to fold in
- EXTRACT_STRUCT_VALUE_ADDRESS as, dependant on the ABI, the debug
- info, and the level of effort, it may well be possible to find the
- address of a structure being return on the stack. Someone else can
- make that change. */
+ into RETURN_VALUE. */
typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type);
extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type);
@@ -1513,29 +1509,47 @@ extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_
#define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type))
#endif
-#if defined (EXTRACT_STRUCT_VALUE_ADDRESS)
-/* Legacy for systems yet to multi-arch EXTRACT_STRUCT_VALUE_ADDRESS */
-#if !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
-#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
+/* As of 2004-01-17 only the 32-bit SPARC ABI has been identified as an
+ ABI suitable for the implementation of a robust extract
+ struct-convention return-value address method (the sparc saves the
+ address in the callers frame). All the other cases so far examined,
+ the DEPRECATED_EXTRACT_STRUCT_VALUE implementation has been
+ erreneous - the code was incorrectly assuming that the return-value
+ address, stored in a register, was preserved across the entire
+ function call.
+ For the moment retain DEPRECATED_EXTRACT_STRUCT_VALUE as a marker of
+ the ABIs that are still to be analyzed - perhaps this should simply
+ be deleted. The commented out extract_returned_value_address method
+ is provided as a starting point for the 32-bit SPARC. It, or
+ something like it, along with changes to both infcmd.c and stack.c
+ will be needed for that case to work. NB: It is passed the callers
+ frame since it is only after the callee has returned that this
+ function is used.
+ M:::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame */
+
+#if defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
+/* Legacy for systems yet to multi-arch DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS */
+#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
#endif
#endif
-extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
-#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
+extern int gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"
#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
-#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_extract_struct_value_address_p (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch))
#endif
-typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (struct regcache *regcache);
-extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache);
-extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS)
-#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
+typedef CORE_ADDR (gdbarch_deprecated_extract_struct_value_address_ftype) (struct regcache *regcache);
+extern CORE_ADDR gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache);
+extern void set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
+#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"
#endif
-#if !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
-#define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_extract_struct_value_address (current_gdbarch, regcache))
+#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_deprecated_extract_struct_value_address (current_gdbarch, regcache))
#endif
#if defined (DEPRECATED_FRAME_INIT_SAVED_REGS)