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][3/13] Eliminate read_register: read_register in mep-tdep.c current_ routines
Date: Thu, 07 Jun 2007 20:58:00 -0000	[thread overview]
Message-ID: <200706072058.l57Kw9Z6019662@d12av02.megacenter.de.ibm.com> (raw)

Hello,

another place in a tdep file where global register state is accessed
in a way that isn't easily eliminable: current_me_module and 
current_options in mep-tdep.c.


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:

	* mep-tdep.c (current_me_module): Read from current regcache
	instead of calling read_register.
	(current_options): Likewise.

diff -urNp gdb-orig/gdb/mep-tdep.c gdb-head/gdb/mep-tdep.c
--- gdb-orig/gdb/mep-tdep.c	2007-06-01 18:21:39.968990155 +0200
+++ gdb-head/gdb/mep-tdep.c	2007-06-01 18:26:33.486246442 +0200
@@ -850,7 +850,12 @@ static CONFIG_ATTR
 current_me_module ()
 {
   if (target_has_registers)
-    return read_register (MEP_MODULE_REGNUM);
+    {
+      ULONGEST regval;
+      regcache_cooked_read_unsigned (current_regcache,
+				     MEP_MODULE_REGNUM, &regval);
+      return regval;
+    }
   else
     return gdbarch_tdep (current_gdbarch)->me_module;
 }
@@ -868,7 +873,12 @@ static unsigned int
 current_options ()
 {
   if (target_has_registers)
-    return read_register (MEP_OPT_REGNUM);
+    {
+      ULONGEST regval;
+      regcache_cooked_read_unsigned (current_regcache,
+				     MEP_OPT_REGNUM, &regval);
+      return regval;
+    }
   else
     return me_module_opt (current_me_module ());
 }
-- 
  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: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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.l57Kw9Z6019662@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