Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Markus Deuling <deuling@de.ibm.com>
To: GDB Patches <gdb-patches@sourceware.org>
Cc: Ulrich Weigand <uweigand@de.ibm.com>
Subject: [rfc] [02/05] Get rid of current_gdbarch in hppa-linux-nat.c
Date: Wed, 07 Nov 2007 11:12:00 -0000	[thread overview]
Message-ID: <47319D46.8080904@de.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 395 bytes --]

Hi,

this patch adds gdbarch as a parameter to hppa_linux_register_addr. 

Tested with gdb_mbuild. Ok to commit ?

ChangeLog:

	* hppa-linux-nat.c (hppa_linux_register_addr): Add gdbarch as parameter.
	Replace current_gdbarch by gdbarch.
	(fetch_register, store_register): Update caller of
	hppa_linux_register_addr.


-- 
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com




[-- Attachment #2: diff-hppa-linux-nat --]
[-- Type: text/plain, Size: 1494 bytes --]

diff -urpN src/gdb/hppa-linux-nat.c dev/gdb/hppa-linux-nat.c
--- src/gdb/hppa-linux-nat.c	2007-10-08 14:50:56.000000000 +0200
+++ dev/gdb/hppa-linux-nat.c	2007-11-07 09:00:34.000000000 +0100
@@ -152,11 +152,12 @@ static const int u_offsets[] =
   };
 
 static CORE_ADDR
-hppa_linux_register_addr (int regno, CORE_ADDR blockend)
+hppa_linux_register_addr (struct gdbarch *gdbarch, int regno,
+			  CORE_ADDR blockend)
 {
   CORE_ADDR addr;
 
-  if ((unsigned) regno >= gdbarch_num_regs (current_gdbarch))
+  if ((unsigned) regno >= gdbarch_num_regs (gdbarch))
     error (_("Invalid register number %d."), regno);
 
   if (u_offsets[regno] == -1)
@@ -232,7 +233,8 @@ fetch_register (struct regcache *regcach
     tid = PIDGET (inferior_ptid); /* Not a threaded program.  */
 
   errno = 0;
-  val = ptrace (PTRACE_PEEKUSER, tid, hppa_linux_register_addr (regno, 0), 0);
+  val = ptrace (PTRACE_PEEKUSER, tid,
+		hppa_linux_register_addr (gdbarch, regno, 0), 0);
   if (errno != 0)
     error (_("Couldn't read register %s (#%d): %s."), 
 	   gdbarch_register_name (gdbarch, regno),
@@ -260,7 +262,8 @@ store_register (const struct regcache *r
 
   errno = 0;
   regcache_raw_collect (regcache, regno, &val);
-  ptrace (PTRACE_POKEUSER, tid, hppa_linux_register_addr (regno, 0), val);
+  ptrace (PTRACE_POKEUSER, tid,
+	  hppa_linux_register_addr (gdbarch, regno, 0), val);
   if (errno != 0)
     error (_("Couldn't write register %s (#%d): %s."),
 	   gdbarch_register_name (gdbarch, regno),



             reply	other threads:[~2007-11-07 11:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07 11:12 Markus Deuling [this message]
2007-11-07 11:31 ` Mark Kettenis
2007-11-07 11:51   ` Markus Deuling
2007-11-07 12:58     ` Daniel Jacobowitz
2007-11-07 14:52       ` Markus Deuling
2007-11-07 15:06         ` Daniel Jacobowitz
2007-11-08 21:31         ` Ulrich Weigand
2007-11-07 13:16     ` Mark Kettenis

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=47319D46.8080904@de.ibm.com \
    --to=deuling@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.com \
    /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