Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: gdb-patches@sourceware.org
Subject: [rfc][4/13] Eliminate read_register: read_register in deprecated_mips_set_processor_regs_hack
Date: Thu, 07 Jun 2007 20:58:00 -0000	[thread overview]
Message-ID: <200706072058.l57KwV3u019800@d12av02.megacenter.de.ibm.com> (raw)

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


             reply	other threads:[~2007-06-07 20:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-07 20:58 Ulrich Weigand [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200706072058.l57KwV3u019800@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox