This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc] [7/8] Eliminate current_gdbarch from *-tdep.c: mips
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 27 Aug 2008 20:04:49 +0200 (CEST)
- Subject: [rfc] [7/8] Eliminate current_gdbarch from *-tdep.c: mips
Hello,
deprecated_mips_set_processor_regs_hack already uses get_current_regcache,
so it should also use the regcache arch to access register names.
Bye,
Ulrich
ChangeLog:
* mips-tdep.c (deprecated_mips_set_processor_regs_hack): Use
regcache architecture instead of current_gdbarch.
diff -urNp gdb-orig/gdb/mips-tdep.c gdb-head/gdb/mips-tdep.c
--- gdb-orig/gdb/mips-tdep.c 2008-08-26 00:05:35.000000000 +0200
+++ gdb-head/gdb/mips-tdep.c 2008-08-26 00:06:38.000000000 +0200
@@ -4885,11 +4885,12 @@ set_mipsfpu_auto_command (char *args, in
void
deprecated_mips_set_processor_regs_hack (void)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct regcache *regcache = get_current_regcache ();
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
ULONGEST prid;
- regcache_cooked_read_unsigned (get_current_regcache (),
- MIPS_PRID_REGNUM, &prid);
+ regcache_cooked_read_unsigned (regcache, MIPS_PRID_REGNUM, &prid);
if ((prid & ~0xf) == 0x700)
tdep->mips_processor_reg_names = mips_r3041_reg_names;
}
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com