diff options
author | Daniel Jacobowitz <drow@false.org> | 2008-05-02 20:38:16 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2008-05-02 20:38:16 +0000 |
commit | 60c5725ca96c0d9c347f04d37f0e1f6d0f263f41 (patch) | |
tree | 387933a649a79c50e3a372850696b04dbe644995 /gdb/gdbarch.c | |
parent | 574dffa2b953e04f57a359f0e19b2ba42fbcf2a6 (diff) | |
download | gdb-60c5725ca96c0d9c347f04d37f0e1f6d0f263f41.zip gdb-60c5725ca96c0d9c347f04d37f0e1f6d0f263f41.tar.gz gdb-60c5725ca96c0d9c347f04d37f0e1f6d0f263f41.tar.bz2 |
* Makefile.in (arm-tdep.o): Update.
* arm-tdep.c (arm_objfile_data_key, struct arm_mapping_symbol)
(struct arm_per_objfile, arm_compare_mapping_symbols): New.
(arm_pc_is_thumb): Use mapping symbols.
(arm_objfile_data_cleanup, arm_record_special_symbol): New.
(arm_gdbarch_init): Call set_gdbarch_record_special_symbol.
(_initialize_arm_tdep): Initialize arm_objfile_data_key.
* elfread.c (elf_symtab_read): Use gdbarch_record_special_symbol.
* gdbarch.sh: Add record_special_symbol.
* gdbarch.c, gdbarch.h: Regenerated.
* objfiles.c (struct objfile_data): Add cleanup member.
(register_objfile_data_with_cleanup): New function, from
register_objfile_data.
(register_objfile_data): Use it.
(objfile_free_data): Call clear_objfile_data.
(clear_objfile_data): Call cleanup functions.
* objfiles.h (register_objfile_data_with_cleanup): Declare.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 0449aaa..537da18 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -237,6 +237,7 @@ struct gdbarch int sofun_address_maybe_missing; gdbarch_target_signal_from_host_ftype *target_signal_from_host; gdbarch_target_signal_to_host_ftype *target_signal_to_host; + gdbarch_record_special_symbol_ftype *record_special_symbol; }; @@ -366,6 +367,7 @@ struct gdbarch startup_gdbarch = 0, /* sofun_address_maybe_missing */ default_target_signal_from_host, /* target_signal_from_host */ default_target_signal_to_host, /* target_signal_to_host */ + 0, /* record_special_symbol */ /* startup_gdbarch() */ }; @@ -618,6 +620,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */ /* Skip verify of target_signal_from_host, invalid_p == 0 */ /* Skip verify of target_signal_to_host, invalid_p == 0 */ + /* Skip verify of record_special_symbol, has predicate */ buf = ui_file_xstrdup (log, &dummy); make_cleanup (xfree, buf); if (strlen (buf) > 0) @@ -947,6 +950,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: read_pc = <0x%lx>\n", (long) gdbarch->read_pc); fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n", + gdbarch_record_special_symbol_p (gdbarch)); + fprintf_unfiltered (file, + "gdbarch_dump: record_special_symbol = <0x%lx>\n", + (long) gdbarch->record_special_symbol); + fprintf_unfiltered (file, "gdbarch_dump: register_name = <0x%lx>\n", (long) gdbarch->register_name); fprintf_unfiltered (file, @@ -3181,6 +3190,30 @@ set_gdbarch_target_signal_to_host (struct gdbarch *gdbarch, gdbarch->target_signal_to_host = target_signal_to_host; } +int +gdbarch_record_special_symbol_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->record_special_symbol != NULL; +} + +void +gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym) +{ + gdb_assert (gdbarch != NULL); + gdb_assert (gdbarch->record_special_symbol != NULL); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_record_special_symbol called\n"); + gdbarch->record_special_symbol (gdbarch, objfile, sym); +} + +void +set_gdbarch_record_special_symbol (struct gdbarch *gdbarch, + gdbarch_record_special_symbol_ftype record_special_symbol) +{ + gdbarch->record_special_symbol = record_special_symbol; +} + /* Keep a registry of per-architecture data-pointers required by GDB modules. */ |