From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13998 invoked by alias); 19 Jan 2007 11:27:26 -0000 Received: (qmail 13989 invoked by uid 22791); 19 Jan 2007 11:27:26 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate5.de.ibm.com (HELO mtagate5.de.ibm.com) (195.212.29.154) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 19 Jan 2007 11:27:20 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.13.8/8.13.8) with ESMTP id l0JBRGpI176678 for ; Fri, 19 Jan 2007 11:27:16 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.2) with ESMTP id l0JBRGK73272724 for ; Fri, 19 Jan 2007 12:27:16 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l0JBRGF4030670 for ; Fri, 19 Jan 2007 12:27:16 +0100 Received: from [9.152.248.39] (dyn-9-152-248-39.boeblingen.de.ibm.com [9.152.248.39]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l0JBRGSf030667; Fri, 19 Jan 2007 12:27:16 +0100 Message-ID: <45B0AB10.1060205@de.ibm.com> Date: Fri, 19 Jan 2007 11:27:00 -0000 From: Markus Deuling User-Agent: Thunderbird 1.5.0.9 (X11/20070102) MIME-Version: 1.0 To: GDB Patches , drow@false.org Subject: Re: [RFA] gdb/gdbserver/linux-ppc-low.c: Wrong return value in ppc_cannot_store_register() References: <45AF6A01.1020605@de.ibm.com> <20070118162855.GA14330@nevyn.them.org> In-Reply-To: <20070118162855.GA14330@nevyn.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2007-01/txt/msg00407.txt.bz2 Hi, Daniel Jacobowitz schrieb: > On Thu, Jan 18, 2007 at 01:37:21PM +0100, Markus Deuling wrote: >> Hi, >> >> ppc_cannot_store_register() from linux-ppc-low.c returns 2 instead of 1. >> This seems to be broken. In linux-low.c:usr_store_inferior_registers() >> there is following comparison: >> >> if ((*the_low_target.cannot_store_register) (regno) == 1) >> return; >> >> This won't work with ppc low target. The patch returns 1 instead of 2. > > That's the whole point - the return value of two exists to avoid that > check. > > Why did you want this patch, i.e. does it fix a problem you > encountered? > it's not a fix. I didn't realize that there's a "return 2" to avoid that check. As far as I've seen it, *the_low_target.cannot_store_register is called two times in linux-low.c and only there. One time result is compared with 1, the other time with 0. So no one works with that returning 2. If the check has to be avoided in ppc, then the three lines below can re removed, can't they? Then it's like in linux-ppc64-low always returning 0. I think it's not useful to return 2. static int ppc_cannot_store_register (int regno) { - /* Some kernels do not allow us to store fpscr. */ - if (regno == find_regno ("fpscr")) - return 2; return 0; } What do you think about that ? Regards, Markus -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com