This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc] [08/20] Get rid of current_gdbarch in bsd-uthread.c
- From: Markus Deuling <deuling at de dot ibm dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>
- Date: Tue, 30 Oct 2007 10:54:33 +0100
- Subject: [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;