This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc] [5/8] Get rid of current_gdbarch in dbug-rom.c
- From: Markus Deuling <deuling at de dot ibm dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>
- Date: Tue, 09 Oct 2007 13:38:20 +0200
- Subject: [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')