From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12708 invoked by alias); 12 Sep 2004 14:52:40 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 12700 invoked from network); 12 Sep 2004 14:52:38 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 12 Sep 2004 14:52:38 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i8CEqcu9027173 for ; Sun, 12 Sep 2004 10:52:38 -0400 Received: from localhost.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i8CEqZr27708; Sun, 12 Sep 2004 10:52:36 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id CC1DB2BA1; Sun, 12 Sep 2004 08:36:53 -0400 (EDT) Message-ID: <414442E5.8010205@gnu.org> Date: Sun, 12 Sep 2004 14:52:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040831 MIME-Version: 1.0 To: Salvador Eduardo Tropea Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] Fix bug in MI -data-list-register-values, PSEUDO_REGS ignored References: <412CBC9F.2050201@inti.gov.ar> In-Reply-To: <412CBC9F.2050201@inti.gov.ar> Content-Type: multipart/mixed; boundary="------------060702030401000906090203" X-SW-Source: 2004-09/txt/msg00188.txt.bz2 This is a multi-part message in MIME format. --------------060702030401000906090203 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Content-length: 847 > Hi! > > That´s the first time a send a patch here, sorry if I´m doing anything wrong. > > Problem: -data-list-register-values gives an error about invalid register number for some registers reported by -data-list-register-names. Outch! > Solution: The real problem is that mi_cmd_data_list_register_names computes "numregs = NUM_REGS + NUM_PSEUDO_REGS" but mi_cmd_data_list_register_values computes "numregs = NUM_REGS". So the solution is to also compute the pseudo registers. > > The patch is trivial and is attached. > I thing the Changelog entry should be something like: > > 2004-08-25 Salvador E. Tropea > > * mi/mi-main.c (mi_cmd_data_list_register_values): Fixed wrong > register number computation. I've checked in the attached - I stumbled across a few more cases of the same bug. Thanks! Andrew --------------060702030401000906090203 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1449 Index: ChangeLog 2004-09-12 Salvador E. Tropea Andrew Cagney * mi/mi-main.c (mi_cmd_data_list_changed_registers) (mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Include the PSEUDO_REGS in the register number computation. Index: mi/mi-main.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-main.c,v retrieving revision 1.64 diff -p -u -r1.64 mi-main.c --- mi/mi-main.c 3 Aug 2004 00:57:27 -0000 1.64 +++ mi/mi-main.c 12 Sep 2004 14:48:17 -0000 @@ -327,7 +327,7 @@ mi_cmd_data_list_changed_registers (char case, some entries of REGISTER_NAME will change depending upon the particular processor being debugged. */ - numregs = NUM_REGS; + numregs = NUM_REGS + NUM_PSEUDO_REGS; cleanup = make_cleanup_ui_out_list_begin_end (uiout, "changed-registers"); @@ -423,7 +423,7 @@ mi_cmd_data_list_register_values (char * case, some entries of REGISTER_NAME will change depending upon the particular processor being debugged. */ - numregs = NUM_REGS; + numregs = NUM_REGS + NUM_PSEUDO_REGS; if (argc == 0) { @@ -563,7 +563,7 @@ mi_cmd_data_write_register_values (char case, some entries of REGISTER_NAME will change depending upon the particular processor being debugged. */ - numregs = NUM_REGS; + numregs = NUM_REGS + NUM_PSEUDO_REGS; if (argc == 0) { --------------060702030401000906090203--