public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Christian Biesinger <cbiesinger@google.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 4/5] gdb/python: New method to access list of register groups
Date: Thu, 18 Jun 2020 09:44:11 +0100	[thread overview]
Message-ID: <20200618084411.GW2737@embecosm.com> (raw)
In-Reply-To: <CAPTJ0XFXs=Q8t9GQ8kTH3hVdG7LGcie1gJHtTKnqo8zKQ-_LVw@mail.gmail.com>

* Christian Biesinger <cbiesinger@google.com> [2020-06-17 13:40:47 -0500]:

> On Wed, Jun 17, 2020 at 12:38 PM Andrew Burgess
> <andrew.burgess@embecosm.com> wrote:
> >
> > Add a new method gdb.Architecture.register_groups which returns a new
> > object of type gdb.RegisterGroupsIterator.  This new iterator then
> > returns objects of type gdb.RegisterGroup.
> >
> > Each gdb.RegisterGroup object just wraps a single reggroup pointer,
> > and (currently) has just one read-only property 'name' that is a
> > string, the name of the register group.
> >
> > As with the previous commit (adding gdb.RegisterDescriptor) I made
> > gdb.RegisterGroup an object rather than just a string in case we want
> > to add additional properties in the future.
> 
> So this adds just the ability to get the names of the groups, without
> a way to associate specific registers with the group? Out of
> curiosity, what's the use case for that?

I did consider that, but remember that groups exist across
architectures.  That is, there's only one "all" group that everyone
shares.

As such to go from group -> registers you would have to supply an
architecture.  And by that point you may just as well call the
registers method on the architecture.

As for use case the only thing that comes immediately to mind would be
if you wanted to implement a new kind of register viewing window in
the TUI.  This would provide a way for Python to figure out which
register groups exist.

Honestly, I needed the registers API to write my test (for a later
patch in the series), and I added this one mostly just because I was
working in the area and it seemed kind-of related.

Thanks,
Andrew

  reply	other threads:[~2020-06-18  8:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 17:38 [PATCH 0/5] Python Unwinders and Inline Frames Andrew Burgess
2020-06-17 17:38 ` [PATCH 1/5] gdb: Remove deprecated_set_gdbarch_data Andrew Burgess
2020-06-18 21:11   ` Tom Tromey
2020-06-17 17:38 ` [PATCH 2/5] gdb/python: Add architecture method to gdb.PendingFrame Andrew Burgess
2020-06-17 18:20   ` Eli Zaretskii
2020-06-18 21:18   ` Tom Tromey
2020-06-17 17:38 ` [PATCH 3/5] gdb/python: Add gdb.Architecture.registers method Andrew Burgess
2020-06-17 18:25   ` Eli Zaretskii
2020-06-18 21:24   ` Tom Tromey
2020-06-17 17:38 ` [PATCH 4/5] gdb/python: New method to access list of register groups Andrew Burgess
2020-06-17 18:27   ` Eli Zaretskii
2020-06-17 18:40   ` Christian Biesinger
2020-06-18  8:44     ` Andrew Burgess [this message]
2020-06-18 21:27   ` Tom Tromey
2020-06-17 17:38 ` [PATCH 5/5] gdb: Fix Python unwinders and inline frames Andrew Burgess
2020-06-17 21:14   ` Luis Machado
2020-06-18  8:25     ` Andrew Burgess
2020-06-18 10:29       ` Luis Machado
2020-06-18 17:42         ` Andrew Burgess
2020-06-18 21:35   ` Tom Tromey
2020-06-22 15:47   ` Andrew Burgess
2020-06-23 14:16     ` Luis Machado
2020-07-02 21:07     ` Andrew Burgess
2020-07-06 17:43       ` Andrew Burgess

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=20200618084411.GW2737@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=cbiesinger@google.com \
    --cc=gdb-patches@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).