From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15885 invoked by alias); 19 Jun 2009 15:35:39 -0000 Received: (qmail 15833 invoked by uid 22791); 19 Jun 2009 15:35:24 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 19 Jun 2009 15:35:19 +0000 Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id n5JFZGdA008503 for ; Fri, 19 Jun 2009 08:35:16 -0700 Received: from yw-out-1718.google.com (ywr5.prod.google.com [10.192.18.5]) by wpaz33.hot.corp.google.com with ESMTP id n5JFZDOp013642 for ; Fri, 19 Jun 2009 08:35:14 -0700 Received: by yw-out-1718.google.com with SMTP id 5so936107ywr.82 for ; Fri, 19 Jun 2009 08:35:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.68.20 with SMTP id q20mr2231357aga.93.1245425713612; Fri, 19 Jun 2009 08:35:13 -0700 (PDT) In-Reply-To: References: Date: Fri, 19 Jun 2009 15:35:00 -0000 Message-ID: Subject: Re: [patch] gdbserver regcache fetch all regs From: Doug Evans To: Aleksandar Ristovski Cc: gdb-patches@sources.redhat.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-System-Of-Record: true 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: 2009-06/txt/msg00507.txt.bz2 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. 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?