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] [08/20] Get rid of current_gdbarch in bsd-uthread.c


Hi,

this patch gets rid of some of the current_gdbarch's in bsd-uthread.c

Is this ok to commit?

ChangeLog:


* bsd-uthread.c (bsd_uthread_fetch_registers) (bsd_uthread_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



diff -urpN src/gdb/bsd-uthread.c dev/gdb/bsd-uthread.c
--- src/gdb/bsd-uthread.c	2007-08-23 20:08:26.000000000 +0200
+++ dev/gdb/bsd-uthread.c	2007-10-30 06:22:55.000000000 +0100
@@ -266,7 +266,7 @@ bsd_uthread_mourn_inferior (void)
 static void
 bsd_uthread_fetch_registers (struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = current_gdbarch;
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   struct bsd_uthread_ops *ops = gdbarch_data (gdbarch, bsd_uthread_data);
   CORE_ADDR addr = ptid_get_tid (inferior_ptid);
   CORE_ADDR active_addr;
@@ -292,7 +292,7 @@ bsd_uthread_fetch_registers (struct regc
 static void
 bsd_uthread_store_registers (struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = current_gdbarch;
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   struct bsd_uthread_ops *ops = gdbarch_data (gdbarch, bsd_uthread_data);
   CORE_ADDR addr = ptid_get_tid (inferior_ptid);
   CORE_ADDR active_addr;


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