aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-05-02 01:38:27 +0000
committerAndrew Cagney <cagney@redhat.com>2002-05-02 01:38:27 +0000
commitcf17c188f5ab09846da88d05da7357c9846375b0 (patch)
treea8878f7cdf945dd0240c7b0648479ddd8ec5e238 /gdb/gdbarch.c
parent6371b78ee245ecc6199864502046b71d36a799ac (diff)
downloadfsf-binutils-gdb-cf17c188f5ab09846da88d05da7357c9846375b0.zip
fsf-binutils-gdb-cf17c188f5ab09846da88d05da7357c9846375b0.tar.gz
fsf-binutils-gdb-cf17c188f5ab09846da88d05da7357c9846375b0.tar.bz2
Yank previous change - set current arch to NULL.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index ff5072d..f7248fc 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -4887,7 +4887,6 @@ int
gdbarch_update_p (struct gdbarch_info info)
{
struct gdbarch *new_gdbarch;
- struct gdbarch *old_gdbarch;
struct gdbarch_registration *rego;
/* Fill in missing parts of the INFO struct using a number of
@@ -4956,40 +4955,30 @@ gdbarch_update_p (struct gdbarch_info info)
return 0;
}
- /* Swap the data belonging to the old target out. This stops the
- ->init() function trying to refer to the previous architecture. */
- swapout_gdbarch_swap (current_gdbarch);
- init_gdbarch_swap (current_gdbarch);
- old_gdbarch = current_gdbarch;
- current_gdbarch = NULL;
-
/* Ask the target for a replacement architecture. */
new_gdbarch = rego->init (info, rego->arches);
- /* Did the target like it? No. Reject the change and revert to the
- old architecture. */
+ /* Did the target like it? No. Reject the change. */
if (new_gdbarch == NULL)
{
if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n");
- swapin_gdbarch_swap (old_gdbarch);
- current_gdbarch = old_gdbarch;
return 0;
}
- /* Did the architecture change? No. Oops, put the old architecture
- back. */
- if (old_gdbarch == new_gdbarch)
+ /* Did the architecture change? No. Do nothing. */
+ if (current_gdbarch == new_gdbarch)
{
if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
(long) new_gdbarch,
new_gdbarch->bfd_arch_info->printable_name);
- swapin_gdbarch_swap (old_gdbarch);
- current_gdbarch = old_gdbarch;
return 1;
}
+ /* Swap all data belonging to the old target out */
+ swapout_gdbarch_swap (current_gdbarch);
+
/* Is this a pre-existing architecture? Yes. Move it to the front
of the list of architectures (keeping the list sorted Most
Recently Used) and then copy it in. */
@@ -5046,10 +5035,14 @@ gdbarch_update_p (struct gdbarch_info info)
new_gdbarch->dump_tdep = rego->dump_tdep;
verify_gdbarch (new_gdbarch);
- /* Initialize the per-architecture data-pointers and swap areas for
- all parties that registered an interest in this architecture.
- CURRENT_GDBARCH must be updated before these modules are called.
- The swap area's will have already been initialized to zero. */
+ /* Initialize the per-architecture memory (swap) areas.
+ CURRENT_GDBARCH must be update before these modules are
+ called. */
+ init_gdbarch_swap (new_gdbarch);
+
+ /* Initialize the per-architecture data-pointer of all parties that
+ registered an interest in this architecture. CURRENT_GDBARCH
+ must be updated before these modules are called. */
init_gdbarch_data (new_gdbarch);
architecture_changed_event ();