diff options
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r-- | gdb/gdbarch.h | 321 |
1 files changed, 175 insertions, 146 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 9f45459..b76bf4a 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -46,6 +46,7 @@ struct frame_info; struct value; struct objfile; struct minimal_symbol; +struct regcache; extern struct gdbarch *current_gdbarch; @@ -414,17 +415,17 @@ extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_ #endif #endif -extern int gdbarch_register_read_p (struct gdbarch *gdbarch); +extern int gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch); -typedef void (gdbarch_register_read_ftype) (struct gdbarch *gdbarch, int regnum, char *buf); -extern void gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf); -extern void set_gdbarch_register_read (struct gdbarch *gdbarch, gdbarch_register_read_ftype *register_read); +typedef void (gdbarch_pseudo_register_read_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf); +extern void gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf); +extern void set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype *pseudo_register_read); -extern int gdbarch_register_write_p (struct gdbarch *gdbarch); +extern int gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch); -typedef void (gdbarch_register_write_ftype) (struct gdbarch *gdbarch, int regnum, char *buf); -extern void gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf); -extern void set_gdbarch_register_write (struct gdbarch *gdbarch, gdbarch_register_write_ftype *register_write); +typedef void (gdbarch_pseudo_register_write_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf); +extern void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf); +extern void set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype *pseudo_register_write); extern int gdbarch_num_regs (struct gdbarch *gdbarch); extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs); @@ -658,8 +659,8 @@ extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_d #define REGISTER_NAME(regnr) (legacy_register_name (regnr)) #endif -typedef char * (gdbarch_register_name_ftype) (int regnr); -extern char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr); +typedef const char * (gdbarch_register_name_ftype) (int regnr); +extern const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr); extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_NAME) #error "Non multi-arch definition of REGISTER_NAME" @@ -692,6 +693,11 @@ extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_by #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE) +#define REGISTER_BYTE(reg_nr) (generic_register_byte (reg_nr)) +#endif + typedef int (gdbarch_register_byte_ftype) (int reg_nr); extern int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr); extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte); @@ -772,9 +778,29 @@ extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_ #endif #endif +#if defined (DO_REGISTERS_INFO) +/* Legacy for systems yet to multi-arch DO_REGISTERS_INFO */ +#if !defined (DO_REGISTERS_INFO_P) +#define DO_REGISTERS_INFO_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO_P) +#define DO_REGISTERS_INFO_P() (0) +#endif + +extern int gdbarch_do_registers_info_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DO_REGISTERS_INFO_P) +#error "Non multi-arch definition of DO_REGISTERS_INFO" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DO_REGISTERS_INFO_P) +#define DO_REGISTERS_INFO_P() (gdbarch_do_registers_info_p (current_gdbarch)) +#endif + /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO) -#define DO_REGISTERS_INFO(reg_nr, fpregs) (do_registers_info (reg_nr, fpregs)) +#define DO_REGISTERS_INFO(reg_nr, fpregs) (internal_error (__FILE__, __LINE__, "DO_REGISTERS_INFO"), 0) #endif typedef void (gdbarch_do_registers_info_ftype) (int reg_nr, int fpregs); @@ -789,29 +815,28 @@ extern void set_gdbarch_do_registers_info (struct gdbarch *gdbarch, gdbarch_do_r #endif #endif -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (PRINT_FLOAT_INFO) -#define PRINT_FLOAT_INFO() (default_print_float_info ()) -#endif +typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all); +extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all); +extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info); + +extern int gdbarch_print_float_info_p (struct gdbarch *gdbarch); -typedef void (gdbarch_print_float_info_ftype) (void); -extern void gdbarch_print_float_info (struct gdbarch *gdbarch); +typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); +extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PRINT_FLOAT_INFO) -#error "Non multi-arch definition of PRINT_FLOAT_INFO" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PRINT_FLOAT_INFO) -#define PRINT_FLOAT_INFO() (gdbarch_print_float_info (current_gdbarch)) -#endif -#endif + +extern int gdbarch_print_vector_info_p (struct gdbarch *gdbarch); + +typedef void (gdbarch_print_vector_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); +extern void gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args); +extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_print_vector_info_ftype *print_vector_info); /* MAP a GDB RAW register number onto a simulator register number. See also include/...-sim.h. */ /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (REGISTER_SIM_REGNO) -#define REGISTER_SIM_REGNO(reg_nr) (default_register_sim_regno (reg_nr)) +#define REGISTER_SIM_REGNO(reg_nr) (legacy_register_sim_regno (reg_nr)) #endif typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr); @@ -1184,18 +1209,19 @@ extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch #endif #endif -/* GET_SAVED_REGISTER is like DUMMY_FRAMES. It is at level one as the - old code has strange #ifdef interaction. So far no one has found - that default_get_saved_register() is the default they are after. */ +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (GET_SAVED_REGISTER) +#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (generic_unwind_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)) +#endif typedef void (gdbarch_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); extern void gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register); -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER) #error "Non multi-arch definition of GET_SAVED_REGISTER" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER) #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval)) #endif #endif @@ -1302,88 +1328,6 @@ extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_valu #endif #endif -/* This function is called when the value of a pseudo-register needs to - be updated. Typically it will be defined on a per-architecture - basis. */ - -#if defined (FETCH_PSEUDO_REGISTER) -/* Legacy for systems yet to multi-arch FETCH_PSEUDO_REGISTER */ -#if !defined (FETCH_PSEUDO_REGISTER_P) -#define FETCH_PSEUDO_REGISTER_P() (1) -#endif -#endif - -/* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER_P) -#define FETCH_PSEUDO_REGISTER_P() (0) -#endif - -extern int gdbarch_fetch_pseudo_register_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER_P) -#error "Non multi-arch definition of FETCH_PSEUDO_REGISTER" -#endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER_P) -#define FETCH_PSEUDO_REGISTER_P() (gdbarch_fetch_pseudo_register_p (current_gdbarch)) -#endif - -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER) -#define FETCH_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "FETCH_PSEUDO_REGISTER"), 0) -#endif - -typedef void (gdbarch_fetch_pseudo_register_ftype) (int regnum); -extern void gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum); -extern void set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER) -#error "Non multi-arch definition of FETCH_PSEUDO_REGISTER" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER) -#define FETCH_PSEUDO_REGISTER(regnum) (gdbarch_fetch_pseudo_register (current_gdbarch, regnum)) -#endif -#endif - -/* This function is called when the value of a pseudo-register needs to - be set or stored. Typically it will be defined on a - per-architecture basis. */ - -#if defined (STORE_PSEUDO_REGISTER) -/* Legacy for systems yet to multi-arch STORE_PSEUDO_REGISTER */ -#if !defined (STORE_PSEUDO_REGISTER_P) -#define STORE_PSEUDO_REGISTER_P() (1) -#endif -#endif - -/* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER_P) -#define STORE_PSEUDO_REGISTER_P() (0) -#endif - -extern int gdbarch_store_pseudo_register_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER_P) -#error "Non multi-arch definition of STORE_PSEUDO_REGISTER" -#endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER_P) -#define STORE_PSEUDO_REGISTER_P() (gdbarch_store_pseudo_register_p (current_gdbarch)) -#endif - -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER) -#define STORE_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "STORE_PSEUDO_REGISTER"), 0) -#endif - -typedef void (gdbarch_store_pseudo_register_ftype) (int regnum); -extern void gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum); -extern void set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch, gdbarch_store_pseudo_register_ftype *store_pseudo_register); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER) -#error "Non multi-arch definition of STORE_PSEUDO_REGISTER" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER) -#define STORE_PSEUDO_REGISTER(regnum) (gdbarch_store_pseudo_register (current_gdbarch, regnum)) -#endif -#endif - /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (POINTER_TO_ADDRESS) #define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf)) @@ -1472,18 +1416,6 @@ extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_ #endif #endif -typedef void (gdbarch_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf); -extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf); -extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE) -#error "Non multi-arch definition of EXTRACT_RETURN_VALUE" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE) -#define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regbuf, valbuf)) -#endif -#endif - /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (PUSH_ARGUMENTS) #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (default_push_arguments (nargs, args, sp, struct_return, struct_addr)) @@ -1574,15 +1506,61 @@ extern void set_gdbarch_store_struct_return (struct gdbarch *gdbarch, gdbarch_st #endif #endif -typedef void (gdbarch_store_return_value_ftype) (struct type *type, char *valbuf); -extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf); +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_RETURN_VALUE) +#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (legacy_extract_return_value (type, regcache, valbuf)) +#endif + +typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, void *valbuf); +extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf); +extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE) +#error "Non multi-arch definition of EXTRACT_RETURN_VALUE" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE) +#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regcache, valbuf)) +#endif +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (STORE_RETURN_VALUE) +#define STORE_RETURN_VALUE(type, regcache, valbuf) (legacy_store_return_value (type, regcache, valbuf)) +#endif + +typedef void (gdbarch_store_return_value_ftype) (struct type *type, struct regcache *regcache, const void *valbuf); +extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf); extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_RETURN_VALUE) #error "Non multi-arch definition of STORE_RETURN_VALUE" #endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_RETURN_VALUE) -#define STORE_RETURN_VALUE(type, valbuf) (gdbarch_store_return_value (current_gdbarch, type, valbuf)) +#define STORE_RETURN_VALUE(type, regcache, valbuf) (gdbarch_store_return_value (current_gdbarch, type, regcache, valbuf)) +#endif +#endif + +typedef void (gdbarch_deprecated_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf); +extern void gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf); +extern void set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_RETURN_VALUE) +#error "Non multi-arch definition of DEPRECATED_EXTRACT_RETURN_VALUE" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_RETURN_VALUE) +#define DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_deprecated_extract_return_value (current_gdbarch, type, regbuf, valbuf)) +#endif +#endif + +typedef void (gdbarch_deprecated_store_return_value_ftype) (struct type *type, char *valbuf); +extern void gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf); +extern void set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_RETURN_VALUE) +#error "Non multi-arch definition of DEPRECATED_STORE_RETURN_VALUE" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_RETURN_VALUE) +#define DEPRECATED_STORE_RETURN_VALUE(type, valbuf) (gdbarch_deprecated_store_return_value (current_gdbarch, type, valbuf)) #endif #endif @@ -1608,18 +1586,55 @@ extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch); /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS) -#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0) +#define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0) #endif -typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (char *regbuf); -extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf); +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" #endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS) -#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_extract_struct_value_address (current_gdbarch, regbuf)) +#define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_extract_struct_value_address (current_gdbarch, regcache)) +#endif +#endif + +#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 + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P) +#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (0) +#endif + +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 (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P) +#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) +#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"), 0) +#endif + +typedef CORE_ADDR (gdbarch_deprecated_extract_struct_value_address_ftype) (char *regbuf); +extern CORE_ADDR gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf); +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 GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) +#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_deprecated_extract_struct_value_address (current_gdbarch, regbuf)) #endif #endif @@ -1887,7 +1902,7 @@ extern void set_gdbarch_frame_chain (struct gdbarch *gdbarch, gdbarch_frame_chai /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN_VALID) -#define FRAME_CHAIN_VALID(chain, thisframe) (func_frame_chain_valid (chain, thisframe)) +#define FRAME_CHAIN_VALID(chain, thisframe) (generic_func_frame_chain_valid (chain, thisframe)) #endif typedef int (gdbarch_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe); @@ -2294,7 +2309,7 @@ extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_s /* For SVR4 shared libraries, each call goes through a small piece of trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates - to nonzero if we are current stopped in one of these. */ + to nonzero if we are currently stopped in one of these. */ /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE) @@ -2313,6 +2328,25 @@ extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbar #endif #endif +/* Some systems also have trampoline code for returning from shared libs. */ + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_RETURN_TRAMPOLINE) +#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (generic_in_solib_return_trampoline (pc, name)) +#endif + +typedef int (gdbarch_in_solib_return_trampoline_ftype) (CORE_ADDR pc, char *name); +extern int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name); +extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_RETURN_TRAMPOLINE) +#error "Non multi-arch definition of IN_SOLIB_RETURN_TRAMPOLINE" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_RETURN_TRAMPOLINE) +#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (gdbarch_in_solib_return_trampoline (current_gdbarch, pc, name)) +#endif +#endif + /* Sigtramp is a routine that the kernel calls (which then calls the signal handler). On most machines it is a library routine that is linked into the executable. @@ -2591,20 +2625,15 @@ extern int gdbarch_update_p (struct gdbarch_info info); for the reserved data-pointer is returned. That identifer should be saved in a local static variable. - The per-architecture data-pointer can be initialized in one of two - ways: The value can be set explicitly using a call to - set_gdbarch_data(); the value can be set implicitly using the value - returned by a non-NULL INIT() callback. INIT(), when non-NULL is - called after the basic architecture vector has been created. + The per-architecture data-pointer is either initialized explicitly + (set_gdbarch_data()) or implicitly (by INIT() via a call to + gdbarch_data()). FREE() is called to delete either an existing + data-pointer overridden by set_gdbarch_data() or when the + architecture object is being deleted. When a previously created architecture is re-selected, the per-architecture data-pointer for that previous architecture is - restored. INIT() is not called. - - During initialization, multiple assignments of the data-pointer are - allowed, non-NULL values are deleted by calling FREE(). If the - architecture is deleted using gdbarch_free() all non-NULL data - pointers are also deleted using FREE(). + restored. INIT() is not re-called. Multiple registrarants for any architecture are allowed (and strongly encouraged). */ @@ -2701,7 +2730,7 @@ extern void initialize_current_architecture (void); /* For non-multiarched targets, do any initialization of the default gdbarch object necessary after the _initialize_MODULE functions have run. */ -extern void initialize_non_multiarch (); +extern void initialize_non_multiarch (void); /* gdbarch trace variable */ extern int gdbarch_debug; |