aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2012-12-15 14:27:56 +0000
committerJoel Brobecker <brobecker@gnat.com>2012-12-15 14:27:56 +0000
commit7e35103a303c52a8ae636600db6fcba630758a91 (patch)
treeaa2669e5a3943736b362b2289ff0d40c66b99c2e /gdb/gdbarch.c
parent25abf4decf405891fa9ad0d5ad138e021a5a872b (diff)
downloadgdb-7e35103a303c52a8ae636600db6fcba630758a91.zip
gdb-7e35103a303c52a8ae636600db6fcba630758a91.tar.gz
gdb-7e35103a303c52a8ae636600db6fcba630758a91.tar.bz2
gdbarch-ification of ravenscar-thread support.
gdb/ChangeLog: * gdbarch.sh: Add "struct ravenscar_arch_ops" advance declaration. (ravenscar_ops): New gdbarch variable. * gdbarch.h, gdbarch.c: Regenerate. * ravenscar-thread.h (ravenscar_register_arch_ops): Delete. * ravenscar-thread.c (current_arch_ops): Delete. (ravenscar_fetch_registers): Get the ravenscar_arch_ops from the gdbarch. (ravenscar_store_registers, ravenscar_prepare_to_store): Likewise. (ravenscar_inferior_created): Add gdbarch_ravenscar_ops check. (ravenscar_register_arch_ops): Delete. * ravenscar-sparc-thread.h: New file. * ravenscar-sparc-thread.c: #include "ravenscar-sparc-thread.h". (ravenscar_sparc_ops): Define value statically. (_initialize_ravenscar_sparc): Delete. (register_sparc_ravenscar_ops): New function. * sparc-tdep.c: #include "ravenscar-sparc-thread.h". (sparc32_gdbarch_init): Add call to register_sparc_ravenscar_ops. * Makefile.in (ALL_TARGET_OBS): Add ravenscar-thread.o and ravenscar-sparc-thread.o. (SFILES): Add ravenscar-thread.c. (HFILES_NO_SRCDIR): Add ravenscar-sparc-thread.h. (ALLDEPFILES): ravenscar-sparc-thread.c. * configure.tgt: Add ravenscar-thread.o and ravenscar-sparc-thread.o to gdb_target_obs for all the targets that use sparc-tdep.o.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 32fe26b..e15f911 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -285,6 +285,7 @@ struct gdbarch
gdbarch_info_proc_ftype *info_proc;
gdbarch_core_info_proc_ftype *core_info_proc;
gdbarch_iterate_over_objfiles_in_search_order_ftype *iterate_over_objfiles_in_search_order;
+ struct ravenscar_arch_ops * ravenscar_ops;
};
@@ -454,6 +455,7 @@ struct gdbarch startup_gdbarch =
0, /* info_proc */
0, /* core_info_proc */
default_iterate_over_objfiles_in_search_order, /* iterate_over_objfiles_in_search_order */
+ NULL, /* ravenscar_ops */
/* startup_gdbarch() */
};
@@ -544,6 +546,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
gdbarch->auto_wide_charset = default_auto_wide_charset;
gdbarch->gen_return_address = default_gen_return_address;
gdbarch->iterate_over_objfiles_in_search_order = default_iterate_over_objfiles_in_search_order;
+ gdbarch->ravenscar_ops = NULL;
/* gdbarch_alloc() */
return gdbarch;
@@ -754,6 +757,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of info_proc, has predicate. */
/* Skip verify of core_info_proc, has predicate. */
/* Skip verify of iterate_over_objfiles_in_search_order, invalid_p == 0 */
+ /* Skip verify of ravenscar_ops, invalid_p == 0 */
buf = ui_file_xstrdup (log, &length);
make_cleanup (xfree, buf);
if (length > 0)
@@ -1201,6 +1205,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: push_dummy_code = <%s>\n",
host_address_to_string (gdbarch->push_dummy_code));
fprintf_unfiltered (file,
+ "gdbarch_dump: ravenscar_ops = %s\n",
+ host_address_to_string (gdbarch->ravenscar_ops));
+ fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_read_pc_p() = %d\n",
gdbarch_read_pc_p (gdbarch));
fprintf_unfiltered (file,
@@ -4300,6 +4307,23 @@ set_gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch,
gdbarch->iterate_over_objfiles_in_search_order = iterate_over_objfiles_in_search_order;
}
+struct ravenscar_arch_ops *
+gdbarch_ravenscar_ops (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of ravenscar_ops, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_ravenscar_ops called\n");
+ return gdbarch->ravenscar_ops;
+}
+
+void
+set_gdbarch_ravenscar_ops (struct gdbarch *gdbarch,
+ struct ravenscar_arch_ops * ravenscar_ops)
+{
+ gdbarch->ravenscar_ops = ravenscar_ops;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */