* [RFC] Fix bug in MI -data-list-register-values, PSEUDO_REGS ignored
@ 2004-08-25 16:21 Salvador Eduardo Tropea
2004-09-12 14:52 ` Andrew Cagney
0 siblings, 1 reply; 4+ messages in thread
From: Salvador Eduardo Tropea @ 2004-08-25 16:21 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1061 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.
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.
--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set@computer.org set@ieee.org
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013
[-- Attachment #2: -data-list-register-values.patch --]
[-- Type: text/plain, Size: 532 bytes --]
Index: gdb/mi/mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.64
diff -u -r1.64 mi-main.c
--- gdb/mi/mi-main.c 3 Aug 2004 00:57:27 -0000 1.64
+++ gdb/mi/mi-main.c 25 Aug 2004 14:12:50 -0000
@@ -423,7 +423,7 @@
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)
{
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [RFC] Fix bug in MI -data-list-register-values, PSEUDO_REGS ignored
2004-08-25 16:21 [RFC] Fix bug in MI -data-list-register-values, PSEUDO_REGS ignored Salvador Eduardo Tropea
@ 2004-09-12 14:52 ` Andrew Cagney
2004-09-13 20:29 ` Salvador Eduardo Tropea
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2004-09-12 14:52 UTC (permalink / raw)
To: Salvador Eduardo Tropea; +Cc: gdb-patches
[-- 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)
{
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [RFC] Fix bug in MI -data-list-register-values, PSEUDO_REGS ignored
2004-09-12 14:52 ` Andrew Cagney
@ 2004-09-13 20:29 ` Salvador Eduardo Tropea
2004-09-13 20:53 ` Andrew Cagney
0 siblings, 1 reply; 4+ messages in thread
From: Salvador Eduardo Tropea @ 2004-09-13 20:29 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
Andrew Cagney wrote:
>> 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!
Thank you. Now you can close bug report "mi/1770". As I didn´t get any
answer I filled it to avoid lossing the patch.
Regards, SET
--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set@computer.org set@ieee.org
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-09-13 20:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-25 16:21 [RFC] Fix bug in MI -data-list-register-values, PSEUDO_REGS ignored Salvador Eduardo Tropea
2004-09-12 14:52 ` Andrew Cagney
2004-09-13 20:29 ` Salvador Eduardo Tropea
2004-09-13 20:53 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox