Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] [02/05] Get rid of current_gdbarch in hppa-linux-nat.c
@ 2007-11-07 11:12 Markus Deuling
  2007-11-07 11:31 ` Mark Kettenis
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Deuling @ 2007-11-07 11:12 UTC (permalink / raw)
  To: GDB Patches; +Cc: Ulrich Weigand

[-- 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),



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

end of thread, other threads:[~2007-11-08 21:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-07 11:12 [rfc] [02/05] Get rid of current_gdbarch in hppa-linux-nat.c Markus Deuling
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

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