From: Andrew Cagney <cagney@gnu.org>
To: Salvador Eduardo Tropea <salvador@inti.gov.ar>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] Fix bug in MI -data-list-register-values, PSEUDO_REGS ignored
Date: Sun, 12 Sep 2004 14:52:00 -0000 [thread overview]
Message-ID: <414442E5.8010205@gnu.org> (raw)
In-Reply-To: <412CBC9F.2050201@inti.gov.ar>
[-- Attachment #1: Type: text/plain, Size: 849 bytes --]
> 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 <set@users.sf.net>
>
> * 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
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1449 bytes --]
Index: ChangeLog
2004-09-12 Salvador E. Tropea <set@users.sf.net>
Andrew Cagney <cagney@gnu.org>
* 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)
{
next prev parent reply other threads:[~2004-09-12 14:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-25 16:21 Salvador Eduardo Tropea
2004-09-12 14:52 ` Andrew Cagney [this message]
2004-09-13 20:29 ` Salvador Eduardo Tropea
2004-09-13 20:53 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=414442E5.8010205@gnu.org \
--to=cagney@gnu.org \
--cc=gdb-patches@sources.redhat.com \
--cc=salvador@inti.gov.ar \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox