Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] [13/17] Get rid of current_gdbarch in win32-nat.c
@ 2007-10-11  8:55 Markus Deuling
  2007-10-11 17:59 ` Christopher Faylor
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Deuling @ 2007-10-11  8:55 UTC (permalink / raw)
  To: GDB Patches; +Cc: Ulrich Weigand, cgf

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

Hi,

this patch gets rid of some of the current_gdbarch's in win32-nat.c. Maybe someone can test this? I have no idea how to :-)
Thanks a lot. Is this ok to commit?

ChangeLog: 


	* win32-nat.c (do_win32_fetch_inferior_registers, win32_resume)
	(do_win32_store_inferior_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-win32-nat --]
[-- Type: text/plain, Size: 1190 bytes --]

diff -urpN src/gdb/win32-nat.c dev/gdb/win32-nat.c
--- src/gdb/win32-nat.c	2007-09-04 03:12:18.000000000 +0200
+++ dev/gdb/win32-nat.c	2007-10-11 10:06:39.000000000 +0200
@@ -397,7 +397,7 @@ do_win32_fetch_inferior_registers (struc
     regcache_raw_supply (regcache, r, context_offset);
   else
     {
-      for (r = 0; r < gdbarch_num_regs (current_gdbarch); r++)
+      for (r = 0; r < gdbarch_num_regs (get_regcache_arch (regcache)); r++)
 	do_win32_fetch_inferior_registers (regcache, r);
     }
 
@@ -424,7 +424,7 @@ do_win32_store_inferior_registers (const
 			  ((char *) &current_thread->context) + mappings[r]);
   else
     {
-      for (r = 0; r < gdbarch_num_regs (current_gdbarch); r++)
+      for (r = 0; r < gdbarch_num_regs (get_regcache_arch (regcache)); r++)
 	do_win32_store_inferior_registers (regcache, r);
     }
 }
@@ -1211,7 +1211,8 @@ win32_resume (ptid_t ptid, int step, enu
 	{
 	  /* Single step by setting t bit */
 	  win32_fetch_inferior_registers (get_current_regcache (),
-					  gdbarch_ps_regnum (current_gdbarch));
+	  				  gdbarch_ps_regnum (get_regcache_arch
+					    (get_current_regcache ())));
 	  th->context.EFlags |= FLAG_TRACE_BIT;
 	}
 




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

end of thread, other threads:[~2007-10-22  6:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-11  8:55 [rfc] [13/17] Get rid of current_gdbarch in win32-nat.c Markus Deuling
2007-10-11 17:59 ` Christopher Faylor
2007-10-22  6:09   ` Markus Deuling

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