This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[rfa:cris] Remove that ``current_gdbarch''


Orjan,

Attatched is hopefully the fix to that ``current_gdbarch == NULL'' 
problem.  I've changed ARCHES so that it is sorted most-recently-used. 
This makes it possible to use ARCHES->gdbarch as a default.

How does it look?

Andrew
2002-04-20  Andrew Cagney  <ac131313@redhat.com>

	* cris-tdep.c (cris_gdbarch_init): Use arches instead of
	current_gdbarch.

Index: cris-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/cris-tdep.c,v
retrieving revision 1.14
diff -u -r1.14 cris-tdep.c
--- cris-tdep.c	18 Mar 2002 02:26:31 -0000	1.14
+++ cris-tdep.c	21 Apr 2002 02:31:40 -0000
@@ -4100,17 +4100,19 @@
           cris_abi = CRIS_ABI_V2;
         }
     }
-  else if (gdbarch_tdep (current_gdbarch))
+  else if (arches != NULL)
     {
-      /* No bfd available.  Stick with whatever ABI we're currently using.  
-         (This is to avoid changing the ABI when the user updates the 
-         architecture with the 'set cris-version' command.)  */
-      cris_abi = gdbarch_tdep (current_gdbarch)->cris_abi;
+      /* No bfd available.  Stick with the ABI from the most recently
+         selected architecture of this same family (the head of arches
+         always points to this).  (This is to avoid changing the ABI
+         when the user updates the architecture with the 'set
+         cris-version' command.)  */
+      cris_abi = gdbarch_tdep (arches->gdbarch)->cris_abi;
     }
   else
     {
-      /* No bfd, and no current architecture available.  Assume it's the 
-         new ABI.  */
+      /* No bfd, and no previously selected architecture available.
+         Assume it's the new ABI.  */
       cris_abi = CRIS_ABI_V2;
     }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]