Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] [14/20] Get rid of current_gdbarch in go32-nat.c
@ 2007-10-30  9:56 Markus Deuling
  2007-10-30 20:50 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Deuling @ 2007-10-30  9:56 UTC (permalink / raw)
  To: GDB Patches; +Cc: Ulrich Weigand

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

Hi,

this patch gets rid of some of the current_gdbarch's in go32-nat.c

Is this ok to commit?

ChangeLog: 


	* go32-nat.c (fetch_register, go32_fetch_registers, store_register)
	(go32_store_registers): Use get_regcache_arch to get at the current
	architecture by regcache.


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




[-- Attachment #2: diff-go32-nat --]
[-- Type: text/plain, Size: 1739 bytes --]

diff -urpN src/gdb/go32-nat.c dev2/gdb/go32-nat.c
--- src/gdb/go32-nat.c	2007-08-23 20:08:33.000000000 +0200
+++ dev2/gdb/go32-nat.c	2007-10-30 07:44:20.000000000 +0100
@@ -465,7 +465,7 @@ go32_wait (ptid_t ptid, struct target_wa
 static void
 fetch_register (struct regcache *regcache, int regno)
 {
-  if (regno < gdbarch_fp0_regnum (current_gdbarch))
+  if (regno < gdbarch_fp0_regnum (get_regcache_arch (regcache)))
     regcache_raw_supply (regcache, regno,
 			 (char *) &a_tss + regno_mapping[regno].tss_ofs);
   else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
@@ -482,7 +482,9 @@ go32_fetch_registers (struct regcache *r
     fetch_register (regcache, regno);
   else
     {
-      for (regno = 0; regno < gdbarch_fp0_regnum (current_gdbarch); regno++)
+      for (regno = 0;
+	   regno < gdbarch_fp0_regnum (get_regcache_arch (regcache));
+	   regno++)
 	fetch_register (regcache, regno);
       i387_supply_fsave (regcache, -1, &npx);
     }
@@ -491,7 +493,7 @@ go32_fetch_registers (struct regcache *r
 static void
 store_register (const struct regcache *regcache, int regno)
 {
-  if (regno < gdbarch_fp0_regnum (current_gdbarch))
+  if (regno < gdbarch_fp0_regnum (get_regcache_arch (regcache)))
     regcache_raw_collect (regcache, regno,
 			  (char *) &a_tss + regno_mapping[regno].tss_ofs);
   else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
@@ -510,7 +512,7 @@ go32_store_registers (struct regcache *r
     store_register (regcache, regno);
   else
     {
-      for (r = 0; r < gdbarch_fp0_regnum (current_gdbarch); r++)
+      for (r = 0; r < gdbarch_fp0_regnum (get_regcache_arch (regcache)); r++)
 	store_register (regcache, r);
       i387_collect_fsave (regcache, -1, &npx);
     }


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

end of thread, other threads:[~2007-10-30 20:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-30  9:56 [rfc] [14/20] Get rid of current_gdbarch in go32-nat.c Markus Deuling
2007-10-30 20:50 ` Eli Zaretskii

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