From 92b729071eddfad07aa5df4f05fc1d3b7fca6923 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Mon, 14 Jun 2010 13:53:04 +0000 Subject: [PATCH] * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR. * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/linux-ppc-low.c | 4 +++- gdb/gdbserver/linux-s390-low.c | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 665556c4df..a43e0ea84d 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2010-06-14 Ulrich Weigand + + * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR. + * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW. + 2010-06-01 Pedro Alves Stan Shebs diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c index 000b20fbf1..48cf7c0917 100644 --- a/gdb/gdbserver/linux-ppc-low.c +++ b/gdb/gdbserver/linux-ppc-low.c @@ -345,8 +345,10 @@ ppc_arch_setup (void) /* Only if the high bit of the MSR is set, we actually have a 64-bit inferior. */ - regcache = get_thread_regcache (current_inferior, 1); + regcache = new_register_cache (); + fetch_inferior_registers (regcache, find_regno ("msr")); collect_register_by_name (regcache, "msr", &msr); + free_register_cache (regcache); if (msr < 0) { ppc_get_hwcap (&ppc_hwcap); diff --git a/gdb/gdbserver/linux-s390-low.c b/gdb/gdbserver/linux-s390-low.c index eb865dc35c..943d8c5dea 100644 --- a/gdb/gdbserver/linux-s390-low.c +++ b/gdb/gdbserver/linux-s390-low.c @@ -270,8 +270,11 @@ s390_arch_setup (void) #ifdef __s390x__ { unsigned int pswm; - struct regcache *regcache = get_thread_regcache (current_inferior, 1); + struct regcache *regcache = new_register_cache (); + fetch_inferior_registers (regcache, find_regno ("pswm")); collect_register_by_name (regcache, "pswm", &pswm); + free_register_cache (regcache); + if (pswm & 1) init_registers_s390x_linux64 (); -- 2.34.1