From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32634 invoked by alias); 19 Jun 2009 15:52:43 -0000 Received: (qmail 32624 invoked by uid 22791); 19 Jun 2009 15:52:42 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from qnxmail.qnx.com (HELO qnxmail.qnx.com) (209.226.137.76) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 19 Jun 2009 15:52:35 +0000 Received: from Nebula.ott.qnx.com (nebula.ott.qnx.com [10.42.3.30]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id LAA09540; Fri, 19 Jun 2009 11:52:28 -0400 Received: from [127.0.0.1] ([10.42.100.129]) by Nebula.ott.qnx.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 19 Jun 2009 11:52:32 -0400 Message-ID: <4A3BB42B.9030208@qnx.com> Date: Fri, 19 Jun 2009 15:52:00 -0000 From: Aleksandar Ristovski User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com CC: Doug Evans Subject: Re: [patch] gdbserver regcache fetch all regs References: In-Reply-To: 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: 2009-06/txt/msg00508.txt.bz2 Doug Evans wrote: > On Tue, Jun 16, 2009 at 6:24 PM, Aleksandar Ristovski wrote: >> Hello, >> >> I believe this is a bug in gdbserver/regcache.c >> >> Current code fetches regno 0 and marks regcache valid. I believe correct >> should be: fetch all regs, and mark regache valid. >> [...]; >> ChangeLog: >> >> >> * regcache.c (get_regcache): Fetch all registers instead of >> regno 0 only. >> > > Hi. At first I thought "Yikes!". :-) > But it turns out that all fetch_registers routines treat 0 and -1 equivalently. > I wouldn't hold up this patch (it's fine with me fwiw), though I would > change the ChangeLog entry to something like: "Use -1 instead of 0 to > fetch all registers." since passing 0 does actually fetch all > registers. Very interesting. I see that now, but in target.h it says quite unambiguously: /* Fetch registers from the inferior process. If REGNO is -1, fetch all registers; otherwise, fetch at least REGNO. */ void (*fetch_registers) (int regno); > > It would be good to remove this oddity and stop the conflation of 0 > and -1, but I don't know what would break. > We could run the testsuite and see what happens as a start. > Does anyone know the history behind this? > Thanks, -- Aleksandar Ristovski QNX Software Systems