Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc][4/13] Eliminate read_register: read_register in deprecated_mips_set_processor_regs_hack
@ 2007-06-07 20:58 Ulrich Weigand
  2007-06-08 12:28 ` Maciej W. Rozycki
  0 siblings, 1 reply; 5+ messages in thread
From: Ulrich Weigand @ 2007-06-07 20:58 UTC (permalink / raw)
  To: gdb-patches

Hello,

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.


Bye,
Ulrich


ChangeLog:

	* 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
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-06-12 15:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-07 20:58 [rfc][4/13] Eliminate read_register: read_register in deprecated_mips_set_processor_regs_hack Ulrich Weigand
2007-06-08 12:28 ` Maciej W. Rozycki
2007-06-12 14:19   ` Daniel Jacobowitz
2007-06-12 14:50     ` Maciej W. Rozycki
2007-06-12 15:05       ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox