diff options
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r-- | gdb/gdbarch.h | 56 |
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) |