aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 6bc57af..25e4750 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -457,7 +457,6 @@ struct gdbarch startup_gdbarch =
/* startup_gdbarch() */
};
-struct gdbarch *target_gdbarch = &startup_gdbarch;
/* Create a new ``struct gdbarch'' based on information provided by
``struct gdbarch_info''. */
@@ -4671,11 +4670,19 @@ deprecated_target_gdbarch_select_hack (struct gdbarch *new_gdbarch)
{
gdb_assert (new_gdbarch != NULL);
gdb_assert (new_gdbarch->initialized_p);
- target_gdbarch = new_gdbarch;
+ current_inferior ()->gdbarch = new_gdbarch;
observer_notify_architecture_changed (new_gdbarch);
registers_changed ();
}
+/* Helper for 'target_gdbarch'. */
+
+struct gdbarch *
+get_target_gdbarch (void)
+{
+ return current_inferior ()->gdbarch;
+}
+
extern void _initialize_gdbarch (void);
void