public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug mi/31448] New: [Feature Request] Register's bitfields MI Commands
@ 2024-03-04 14:16 robert.pirvu at cyberthorstudios dot com
  2024-03-04 15:29 ` [Bug mi/31448] " tromey at sourceware dot org
  2024-03-06 12:05 ` robert.pirvu at cyberthorstudios dot com
  0 siblings, 2 replies; 3+ messages in thread
From: robert.pirvu at cyberthorstudios dot com @ 2024-03-04 14:16 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31448

            Bug ID: 31448
           Summary: [Feature Request] Register's bitfields MI Commands
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: mi
          Assignee: unassigned at sourceware dot org
          Reporter: robert.pirvu at cyberthorstudios dot com
  Target Milestone: ---

I'm working on a new functionality for Eclipse to allow Register View to
display bitfields.

For this, I propose two GDB MI Command changes:

    1. A new command to return a list of bitfields' names, similar to
-data-list-register-name.

Command: -data-list-register-bitfield-name (regno) 
Response: ^done,register-bitfield-names=[{name="reg0",
bitfields=["A","B","C"]},{name="reg1", bitfields=["D","E"]}]

If regno(register's number) is specified then the response will contain only
the specified register.

    2. A new option "--with-bitfields" for -data-list-register-values to
include a list of bitfields' values. This option was suggested by Guinevere
Larsen to receive the necessary data and not change the default response of
this command. A similar approach can be used for the bitfields' names MI
Command as well if is a better implementation.   

Command: -data-list-register-values --with-bitfields
Respone:
^done,register-values=[{number="0",value="0x0",bitfields=[0,0,0]},{number="1",value="0x1",bitfields=[0,0]}]

Format of the response: 
[{number="regNo",value="regValue",bitfields=[bitVal1,bitVal2,bitVal3]}]

Initial thread of this
request:https://sourceware.org/pipermail/gdb/2024-February/051071.html

Any feedback regarding this feature is greatly appreciated and we are 
open to contribute to its implementation.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug mi/31448] [Feature Request] Register's bitfields MI Commands
  2024-03-04 14:16 [Bug mi/31448] New: [Feature Request] Register's bitfields MI Commands robert.pirvu at cyberthorstudios dot com
@ 2024-03-04 15:29 ` tromey at sourceware dot org
  2024-03-06 12:05 ` robert.pirvu at cyberthorstudios dot com
  1 sibling, 0 replies; 3+ messages in thread
From: tromey at sourceware dot org @ 2024-03-04 15:29 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31448

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
FWIW I think this seems fine.

For -data-list-register-values, I suppose when returning
bitfields it could also include the field names (if they
exist).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug mi/31448] [Feature Request] Register's bitfields MI Commands
  2024-03-04 14:16 [Bug mi/31448] New: [Feature Request] Register's bitfields MI Commands robert.pirvu at cyberthorstudios dot com
  2024-03-04 15:29 ` [Bug mi/31448] " tromey at sourceware dot org
@ 2024-03-06 12:05 ` robert.pirvu at cyberthorstudios dot com
  1 sibling, 0 replies; 3+ messages in thread
From: robert.pirvu at cyberthorstudios dot com @ 2024-03-06 12:05 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31448

--- Comment #2 from Robert Pîrvu <robert.pirvu at cyberthorstudios dot com> ---
Register View uses two MI Commands to populate the view with registers. One
command which returns the names of the registers, and another which returns the
positions and values of the registers. I wanted to have a bit of consistency
with the commands and that is why I proposed to have something similar, one
command to return the names of bitfields and one for the values. And it will be
a lot easier for this to work with the existing parsers used by the Register
View.

Maybe instead of implementing a new command for getting the bitfield's names,
we can use the same approach by adding a --with-bitfields option to the
-data-list-register-name MI Command. It might be better than having to create a
new MI Command which will be used only in this case.

And I forgot to mention this, in case the register doesn't have bitfields, then
the bitfields list will be empty.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-06 12:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-04 14:16 [Bug mi/31448] New: [Feature Request] Register's bitfields MI Commands robert.pirvu at cyberthorstudios dot com
2024-03-04 15:29 ` [Bug mi/31448] " tromey at sourceware dot org
2024-03-06 12:05 ` robert.pirvu at cyberthorstudios dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).