[rfc] Sort architectures M.R.U.; Was: swap out current when cureating a new architecture

Andrew Cagney ac131313@cygnus.com
Thu Apr 18 14:23:00 GMT 2002


Ref:
http://sources.redhat.com/ml/gdb-patches/2001-10/msg00001.html
http://sources.redhat.com/ml/gdb-patches/2001-09/msg00342.html

Hello,

The attached patch changes, very slightly, the way GDB manages 
previously created architectures.

Background:

Several targets were assuming that it was safe to refer to 
``current_gdbarch'' as a way of obtaining information on the previous 
architecture while creating the new one.  In multi-arch, this isn't 
safe.  ``current_gdbarch'' might be set to a completly different 
architecture family (it is also going to be delted) :-(

As a way of stopping this I modified gdbarch_update_p() so that it would 
set current_gdbarch to NULL before trying to create a new architecture. 
  This, in turn, flushed out a problem with the current gdbarch 
mechanism.    The init code, often needs to look back at the most recent 
architecture of the same architecture family so that various defaults 
can be carried forward.

Change:

With this in mind, the attached patch tweaks gdbarch_update_p() so that 
each list of architectures are kept sorted in most-recent-used order. 
This in turn provides the architecture init code with a reliable way of 
accessing the previous architectures without having to refer to 
current_gdbarch.

thoughts?
Andrew
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20020418/c8b2c62f/attachment.ksh>


More information about the Gdb-patches mailing list