This is the mail archive of the 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][4/13] Eliminate read_register: read_register in deprecated_mips_set_processor_regs_hack


one more weird global register access in a tdep file:
deprecated_mips_set_processor_regs_hack in mips-tdep.c.

(Not sure if this is still required, or if it could be replaced by
the new XML register mechanism ...)

To be able to continue elimination of read_register, this patch simply
inlines the definition and reads from current_regcache.  This should
obviously have no change in behaviour.



	* mips-tdep.c (deprecated_mips_set_processor_regs_hack): Read from
	current regcache instead of calling read_register.

diff -urNp gdb-orig/gdb/mips-tdep.c gdb-head/gdb/mips-tdep.c
--- gdb-orig/gdb/mips-tdep.c	2007-06-06 18:57:02.982185081 +0200
+++ gdb-head/gdb/mips-tdep.c	2007-06-06 18:56:16.508824426 +0200
@@ -4314,10 +4314,10 @@ void
 deprecated_mips_set_processor_regs_hack (void)
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-  CORE_ADDR prid;
-  prid = read_register (MIPS_PRID_REGNUM);
+  ULONGEST prid;
+  regcache_cooked_read_unsigned (current_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

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