public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Improvements to Python Register Descriptor API
@ 2020-07-08  8:48 Andrew Burgess
  2020-07-08  8:48 ` [PATCH 1/2] gdb/python: Reuse gdb.RegisterDescriptor objects where possible Andrew Burgess
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Andrew Burgess @ 2020-07-08  8:48 UTC (permalink / raw)
  To: gdb-patches

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


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

end of thread, other threads:[~2020-07-22 15:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08  8:48 [PATCH 0/2] Improvements to Python Register Descriptor API Andrew Burgess
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

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).