Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 3/5] gdb/python: Add gdb.Architecture.registers method
Date: Thu, 18 Jun 2020 15:24:45 -0600	[thread overview]
Message-ID: <87mu50ysma.fsf@tromey.com> (raw)
In-Reply-To: <c2e767bc38f3513c684bda352949e04b76909988.1592415321.git.andrew.burgess@embecosm.com> (Andrew Burgess's message of "Wed, 17 Jun 2020 18:38:07 +0100")

>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:

Thanks for doing this.

Andrew> This commit adds a new method gdb.Architecture.registers that returns
Andrew> an object of the new type gdb.RegisterDescriptorIterator.  This
Andrew> iterator returns objects of the new type gdb.RegisterDescriptor.

Andrew> A RegisterDescriptor is not a way to read the value of a register,
Andrew> this is already covered by Frame.read_register, a RegisterDescriptor
Andrew> is simply a way to discover from Python, which registers are
Andrew> available for a given architecture.

Andrew> I did consider just returning a string, the name of each register,
Andrew> instead of a RegisterDescriptor, however, I'm aware that it we don't
Andrew> want to break the existing Python API in any way, so if I return just
Andrew> a string now, but in the future we want more information about a
Andrew> register then we would have to add a second API to get that
Andrew> information.  By going straight to a descriptor object now, it is easy
Andrew> to add additional properties in the future should we wish to.

Andrew> Right now the only property of a register that a user can access is
Andrew> the name of the register.

Andrew> In future we might want to be able to ask the register about is
Andrew> register groups, or its type.

This all seems reasonable.

Andrew> +int
Andrew> +gdbpy_initialize_registers (void)

No need for "void" here in new code.
Same in the .h.

Looks good to me with those nits fixed.

Tom


  parent reply	other threads:[~2020-06-18 21:24 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 [this message]
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
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=87mu50ysma.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=andrew.burgess@embecosm.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