This is the mail archive of the gdb-patches@sourceware.org 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]

[rfc] [5/8] Get rid of current_gdbarch in dbug-rom.c


Hi,

this patch gets rid of some of the current_gdbarch's in dbug-rom.c

Is this ok to commit?

ChangeLog:


* dbug-rom.c (dbug_supply_register): Use get_regcache_arch to get at the current architecture by regcache.


-- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com



diff -urpN src/gdb/dbug-rom.c dev/gdb/dbug-rom.c
--- src/gdb/dbug-rom.c	2007-08-23 20:08:28.000000000 +0200
+++ dev/gdb/dbug-rom.c	2007-10-09 10:33:20.000000000 +0200
@@ -40,6 +40,7 @@ dbug_supply_register (struct regcache *r
 		      int regnamelen, char *val, int vallen)
 {
   int regno;
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
 
   if (regnamelen != 2)
     return;
@@ -49,12 +50,12 @@ dbug_supply_register (struct regcache *r
     case 'S':
       if (regname[1] != 'R')
 	return;
-      regno = gdbarch_ps_regnum (current_gdbarch);
+      regno = gdbarch_ps_regnum (gdbarch);
       break;
     case 'P':
       if (regname[1] != 'C')
 	return;
-      regno = gdbarch_pc_regnum (current_gdbarch);
+      regno = gdbarch_pc_regnum (gdbarch);
       break;
     case 'D':
       if (regname[1] < '0' || regname[1] > '7')



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