From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 0/2] Improvements to Python Register Descriptor API
Date: Wed, 8 Jul 2020 09:48:10 +0100 [thread overview]
Message-ID: <cover.1594197735.git.andrew.burgess@embecosm.com> (raw)
I was thinking about my recent Python API additions to provide access
to register and register group information, and I thought that the
implementation of the API could be improved.
Currently for both registers and register groups, you ask the
architecture for an iterator, and the iterator then returns
descriptors. Each descriptor returned is a new object, so if you have
two iterators, and ask the the first register you'll get two unique
objects that both describe the same register.
I thought it might be a nice improvement if the objects returned were
the same from every iterator, so in the above example you'd end up
with two references to the same object. In this way you can compare
the objects for equality.
I don't know if this will be useful, but this seems like a better
implementation, so I'd like to change things to work this way
(assuming nobody disagrees).
Thanks,
Andrew
---
Andrew Burgess (2):
gdb/python: Reuse gdb.RegisterDescriptor objects where possible
gdb/python: Reuse gdb.RegisterGroup objects where possible
gdb/ChangeLog | 19 ++++
gdb/python/py-registers.c | 103 ++++++++++++++----
gdb/testsuite/ChangeLog | 8 ++
.../gdb.python/py-arch-reg-groups.exp | 19 ++++
.../gdb.python/py-arch-reg-names.exp | 19 ++++
5 files changed, 146 insertions(+), 22 deletions(-)
--
2.25.4
next reply other threads:[~2020-07-08 8:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-08 8:48 Andrew Burgess [this message]
2020-07-08 8:48 ` [PATCH 1/2] gdb/python: Reuse gdb.RegisterDescriptor objects where possible Andrew Burgess
2020-07-13 18:21 ` Tom Tromey
2020-07-08 8:48 ` [PATCH 2/2] gdb/python: Reuse gdb.RegisterGroup " Andrew Burgess
2020-07-13 18:23 ` Tom Tromey
2020-07-14 17:14 ` [PATCHv2 0/2] Improvements to Python Register Descriptor API Andrew Burgess
2020-07-14 17:14 ` [PATCHv2 1/2] gdb/python: Reuse gdb.RegisterDescriptor objects where possible Andrew Burgess
2020-07-22 13:10 ` Pedro Alves
2020-07-22 14:05 ` Andrew Burgess
2020-07-22 14:32 ` Pedro Alves
2020-07-22 15:10 ` Andrew Burgess
2020-07-14 17:14 ` [PATCHv2 2/2] gdb/python: Reuse gdb.RegisterGroup " Andrew Burgess
2020-07-21 18:26 ` [PATCHv2 0/2] Improvements to Python Register Descriptor API Tom Tromey
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=cover.1594197735.git.andrew.burgess@embecosm.com \
--to=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