X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fgdbarch.h;h=db8c3e10445ff289d5bdc891b534f9a0d2476e0e;hb=0d62e5e8077eecf77e9b7b5dc0d2689d051a3ab3;hp=ada28e3a8adf9250eb265cd16b39e3753fd374d2;hpb=67a2b77effae04a5f6c050fd191149c26deb8a82;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index ada28e3a8a..db8c3e1044 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -558,22 +558,6 @@ extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum); #endif #endif -/* Default (value) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (NNPC_REGNUM) -#define NNPC_REGNUM (-1) -#endif - -extern int gdbarch_nnpc_regnum (struct gdbarch *gdbarch); -extern void set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, int nnpc_regnum); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NNPC_REGNUM) -#error "Non multi-arch definition of NNPC_REGNUM" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NNPC_REGNUM) -#define NNPC_REGNUM (gdbarch_nnpc_regnum (current_gdbarch)) -#endif -#endif - /* Convert stab register number (from `r' declaration) to a gdb REGNUM. */ /* Default (function) for non- multi-arch platforms. */ @@ -720,6 +704,11 @@ extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_RAW_SIZE) +#define REGISTER_RAW_SIZE(reg_nr) (generic_register_size (reg_nr)) +#endif + typedef int (gdbarch_register_raw_size_ftype) (int reg_nr); extern int gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr); extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size); @@ -743,6 +732,11 @@ extern void set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, int max_ #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_SIZE) +#define REGISTER_VIRTUAL_SIZE(reg_nr) (generic_register_size (reg_nr)) +#endif + typedef int (gdbarch_register_virtual_size_ftype) (int reg_nr); extern int gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr); extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size); @@ -795,29 +789,16 @@ 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_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); +extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame); 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 /* 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); @@ -1190,18 +1171,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 @@ -1257,6 +1239,57 @@ extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarc #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (CONVERT_REGISTER_P) +#define CONVERT_REGISTER_P(regnum) (legacy_convert_register_p (regnum)) +#endif + +typedef int (gdbarch_convert_register_p_ftype) (int regnum); +extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum); +extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p); +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_REGISTER_P) +#error "Non multi-arch definition of CONVERT_REGISTER_P" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_REGISTER_P) +#define CONVERT_REGISTER_P(regnum) (gdbarch_convert_register_p (current_gdbarch, regnum)) +#endif +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_TO_VALUE) +#define REGISTER_TO_VALUE(regnum, type, from, to) (legacy_register_to_value (regnum, type, from, to)) +#endif + +typedef void (gdbarch_register_to_value_ftype) (int regnum, struct type *type, char *from, char *to); +extern void gdbarch_register_to_value (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to); +extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value); +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_TO_VALUE) +#error "Non multi-arch definition of REGISTER_TO_VALUE" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_TO_VALUE) +#define REGISTER_TO_VALUE(regnum, type, from, to) (gdbarch_register_to_value (current_gdbarch, regnum, type, from, to)) +#endif +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (VALUE_TO_REGISTER) +#define VALUE_TO_REGISTER(type, regnum, from, to) (legacy_value_to_register (type, regnum, from, to)) +#endif + +typedef void (gdbarch_value_to_register_ftype) (struct type *type, int regnum, char *from, char *to); +extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to); +extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register); +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (VALUE_TO_REGISTER) +#error "Non multi-arch definition of VALUE_TO_REGISTER" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (VALUE_TO_REGISTER) +#define VALUE_TO_REGISTER(type, regnum, from, to) (gdbarch_value_to_register (current_gdbarch, type, regnum, from, to)) +#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. */ @@ -1690,8 +1723,8 @@ extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ #define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr)) #endif -typedef unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr); -extern unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr); +typedef const unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr); +extern const unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr); extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC) #error "Non multi-arch definition of BREAKPOINT_FROM_PC" @@ -1842,7 +1875,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); @@ -2268,6 +2301,44 @@ extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbar #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. + + This macro, given a program counter value and the name of the + function in which that PC resides (which can be null if the name is + not known), returns nonzero if the PC and name show that we are in + sigtramp. + + On most machines just see if the name is sigtramp (and if we have + no name, assume we are not in sigtramp). + + FIXME: cagney/2002-04-21: The function find_pc_partial_function + calls find_pc_sect_partial_function() which calls PC_IN_SIGTRAMP. + This means PC_IN_SIGTRAMP function can't be implemented by doing its + own local NAME lookup. + + FIXME: cagney/2002-04-21: PC_IN_SIGTRAMP is something of a mess. + Some code also depends on SIGTRAMP_START and SIGTRAMP_END but other + does not. */ + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (PC_IN_SIGTRAMP) +#define PC_IN_SIGTRAMP(pc, name) (legacy_pc_in_sigtramp (pc, name)) +#endif + +typedef int (gdbarch_pc_in_sigtramp_ftype) (CORE_ADDR pc, char *name); +extern int gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name); +extern void set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_SIGTRAMP) +#error "Non multi-arch definition of PC_IN_SIGTRAMP" +#endif +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_SIGTRAMP) +#define PC_IN_SIGTRAMP(pc, name) (gdbarch_pc_in_sigtramp (current_gdbarch, pc, name)) +#endif +#endif + /* A target might have problems with watchpoints as soon as the stack frame of the current function has been destroyed. This mostly happens as the first action in a funtion's epilogue. in_function_epilogue_p() @@ -2406,9 +2477,16 @@ extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch); architecture; ARCHES which is a list of the previously created ``struct gdbarch'' for this architecture. - The INIT function parameter INFO shall, as far as possible, be - pre-initialized with information obtained from INFO.ABFD or - previously selected architecture (if similar). + The INFO parameter is, as far as possible, be pre-initialized with + information obtained from INFO.ABFD or the previously selected + architecture. + + The ARCHES parameter is a linked list (sorted most recently used) + of all the previously created architures for this architecture + family. The (possibly NULL) ARCHES->gdbarch can used to access + values from the previously selected architecture for this + architecture family. The global ``current_gdbarch'' shall not be + used. The INIT function shall return any of: NULL - indicating that it doesn't recognize the selected architecture; an existing ``struct @@ -2501,20 +2579,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). */ @@ -2530,7 +2603,7 @@ extern void set_gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data, void *pointer); -extern void *gdbarch_data (struct gdbarch_data*); +extern void *gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *); /* Register per-architecture memory region.