public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Python API: Accept named arguments in a few more places
@ 2023-03-30 12:10 Andrew Burgess
  2023-03-30 12:10 ` [PATCH 1/4] gdb/python: have UnwindInfo.add_saved_register accept named args Andrew Burgess
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Andrew Burgess @ 2023-03-30 12:10 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

While working on the Python Unwinder API for a previous patch set I
spotted that UnwindInfo.add_saved_register doesn't accept named
arguments.

As this function takes two arguments I though that accepting named
arguments might be a nice improvement.  So I started out by fixing
that.

Then for completeness I updated the other two methods in py-unwind.c
that also didn't accept named arguments, even though these functions
only take a single argument I think taking named arguments is in
general better, and consistency is good too.

But having updated PendingFrame.read_register I really _had_ to update
Frame.read_register otherwise the API would be inconsistent -- two
frame like objects both with a read_register method, one taking named
arguments and one not, that seems bad to me.  So then I updated
Frame.read_register.

Having updated one function in py-frame.c, that left just one function
that was not taking named arguments, Frame.read_var, so I updated that
one too.  This one does take multiple arguments, so having named
argument support is more useful here, plus I improved the error
message when an argument of the wrong type is passed.

Thanks,
Andrew


---

Andrew Burgess (4):
  gdb/python: have UnwindInfo.add_saved_register accept named args
  gdb/python: have PendingFrame methods accept keyword arguments
  gdb/python: convert Frame.read_register to take named arguments
  gdb/python: allow Frame.read_var to accept named arguments

 gdb/doc/python.texi                    |  18 ++---
 gdb/python/py-frame.c                  |  39 +++++----
 gdb/python/py-unwind.c                 | 107 +++++++++++++------------
 gdb/testsuite/gdb.python/py-frame.exp  |  40 +++++++++
 gdb/testsuite/gdb.python/py-unwind.exp |  15 +++-
 gdb/testsuite/gdb.python/py-unwind.py  |  32 +++++---
 6 files changed, 160 insertions(+), 91 deletions(-)


base-commit: 3712e78cab09017bf59105d44e2f745c5e608c5a
-- 
2.25.4


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

end of thread, other threads:[~2023-04-06 14:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30 12:10 [PATCH 0/4] Python API: Accept named arguments in a few more places Andrew Burgess
2023-03-30 12:10 ` [PATCH 1/4] gdb/python: have UnwindInfo.add_saved_register accept named args Andrew Burgess
2023-03-30 14:08   ` Eli Zaretskii
2023-04-06 14:10     ` Andrew Burgess
2023-03-30 12:10 ` [PATCH 2/4] gdb/python: have PendingFrame methods accept keyword arguments Andrew Burgess
2023-03-30 14:13   ` Eli Zaretskii
2023-03-30 12:10 ` [PATCH 3/4] gdb/python: convert Frame.read_register to take named arguments Andrew Burgess
2023-03-30 14:10   ` Eli Zaretskii
2023-03-30 12:10 ` [PATCH 4/4] gdb/python: allow Frame.read_var to accept " Andrew Burgess
2023-03-30 14:11   ` Eli Zaretskii
2023-04-04 18:39 ` [PATCH 0/4] Python API: Accept named arguments in a few more places Tom Tromey
2023-04-06 14:11   ` Andrew Burgess

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