summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2008-05-02 20:38:16 +0000
committerDaniel Jacobowitz <dan@debian.org>2008-05-02 20:38:16 +0000
commit3f3cf9508a7807f1c94d3a47fb69431b7b3db305 (patch)
tree818ebf74eb10abbfa35c518c598265119d778246 /gdb/gdbarch.c
parent8c9295063c4a47839762d77e505fe7c4a4397e10 (diff)
downloadgdb-3f3cf9508a7807f1c94d3a47fb69431b7b3db305.tar.gz
* 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.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 0449aaa20dc..537da1861c6 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. */