From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15513 invoked by alias); 21 Jan 2010 22:21:06 -0000 Received: (qmail 15505 invoked by uid 22791); 21 Jan 2010 22:21:05 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Jan 2010 22:21:01 +0000 Received: (qmail 18899 invoked from network); 21 Jan 2010 22:21:00 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 21 Jan 2010 22:21:00 -0000 From: Pedro Alves To: Jan Kratochvil Subject: Re: [obv] [s390] gdbserver regcache compilation fix Date: Thu, 21 Jan 2010 22:21:00 -0000 User-Agent: KMail/1.9.10 Cc: gdb-patches@sourceware.org References: <20100121192852.GA18915@host0.dyn.jankratochvil.net> In-Reply-To: <20100121192852.GA18915@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201001212221.16194.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-01/txt/msg00539.txt.bz2 On Thursday 21 January 2010 19:28:52, Jan Kratochvil wrote: > Hi Pedro, > > checked-in this one as [obv] althought remains IMO-non-obv ppc: Thanks. > > linux-ppc-low.c: In function ‘ppc_arch_setup’: > linux-ppc-low.c:347: warning: passing argument 1 of ‘collect_register_by_name’ from incompatible pointer type > linux-ppc-low.c:347: warning: passing argument 2 of ‘collect_register_by_name’ from incompatible pointer type > linux-ppc-low.c:347: error: too few arguments to function ‘collect_register_by_name’ Hmm, I see, I only built a 32-bit ppc gdbserver, and this is code guarded on #ifdef __powerpc64__. The fix becomes obvious considering that before my change, collect_registers_by_... used to call get_thread_registers itself, the change mostly just moved this call up to the caller sites. I've applied this patch below, after confirming a 64-bit ppc gdbserver now builds. Let me know if something still isn't working. -- Pedro Alves 2010-01-21 Pedro Alves gdb/gdbserver/ * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes. --- gdb/gdbserver/linux-ppc-low.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: src/gdb/gdbserver/linux-ppc-low.c =================================================================== --- src.orig/gdb/gdbserver/linux-ppc-low.c 2010-01-21 13:46:00.000000000 -0800 +++ src/gdb/gdbserver/linux-ppc-low.c 2010-01-21 13:46:09.000000000 -0800 @@ -335,6 +335,7 @@ ppc_arch_setup (void) { #ifdef __powerpc64__ long msr; + struct regcache *regcache; /* On a 64-bit host, assume 64-bit inferior process with no AltiVec registers. Reset ppc_hwcap to ensure that the @@ -344,7 +345,8 @@ ppc_arch_setup (void) /* Only if the high bit of the MSR is set, we actually have a 64-bit inferior. */ - collect_register_by_name ("msr", &msr); + regcache = get_thread_regcache (current_inferior, 1); + collect_register_by_name (regcache, "msr", &msr); if (msr < 0) { ppc_get_hwcap (&ppc_hwcap);