This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[rfc] [13/17] Get rid of current_gdbarch in win32-nat.c


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




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;
 	}
 




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]