mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
gdb: Remove deprecated_set_gdbarch_data
There are currently two remaining uses of deprecated_set_gdbarch_data, both of which are needed because during gdbarch initialisation we call gdbarch_data for a data field that is registered using: gdbarch_data_register_post_init (....) However, in both of these cases, the only thing that the call back needs from the gdbarch struct is its obstack. Given this there is nothing stopping us changing the post-init hooks into pre-init hooks. The pre-init hooks don't get passed the full gdbarch, they only get passed its obstack. The IA64 change is completely untested. The user-regs change has been tested a little by locally adding some user-regs to the x86-64 target, and also by running the RISC-V tests, which do use user-regs. gdb/ChangeLog: * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh (deprecated_set_gdbarch_data): Delete. (gdbarch_data): Use internal_error for the case where deprecated_set_gdbarch_data was originally needed. * ia64-libunwind-tdep.c (libunwind_descr_init): Update parameters, and use passed in obstack. (libunwind_frame_set_descr): Should no longer get back NULL from gdbarch_data. (_initialize_libunwind_frame): Register as a pre-init gdbarch data type. * user-regs.c (user_regs_init): Update parameters, and use passed in obstack. (user_reg_add): Should no longer get back NULL from gdbarch_data. (_initialize_user_regs): Register as a pre-init gdbarch data type.
This commit is contained in:
@ -1839,9 +1839,6 @@ typedef void *(gdbarch_data_pre_init_ftype) (struct obstack *obstack);
|
||||
extern struct gdbarch_data *gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *init);
|
||||
typedef void *(gdbarch_data_post_init_ftype) (struct gdbarch *gdbarch);
|
||||
extern struct gdbarch_data *gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *init);
|
||||
extern void deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
|
||||
struct gdbarch_data *data,
|
||||
void *pointer);
|
||||
|
||||
extern void *gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *);
|
||||
|
||||
|
Reference in New Issue
Block a user