[00/10] Improvements & Cleanup For Python Unwinder API

Message ID cover.1678460067.git.aburgess@redhat.com
Headers
Series Improvements & Cleanup For Python Unwinder API |

Message

Andrew Burgess March 10, 2023, 2:55 p.m. UTC
  For <reasons> I ended up writing a small project using GDB's Unwinder
Python API.  Though I could do everything I wanted, GDB's
documentation in this area seemed a little lacking.

So I started out just planning to cleanup the docs.

But based on my experiences using the API, and after reading the docs
through a couple of times, it felt like there were some small
improvements that could be made to the API to make the lives of users
easier.

This series doesn't make any real changes to the API, but after this
series the docs should be more complete, and the API a little more
robust and easier to use.

Oh, and tests.  Lots more tests.

---

Andrew Burgess (10):
  gdb/doc: spring clean the Python unwinders documentation
  gdb/python: make the gdb.unwinder.Unwinder class more robust
  gdb/python: remove unneeded nullptr check in frapy_block
  gdb/python: add PENDING_FRAMEPY_REQUIRE_VALID macro in py-unwind.c
  gdb/python: add some additional methods to gdb.PendingFrame
  gdb/python: add __repr__ for PendingFrame and UnwindInfo
  gdb/python: remove Py_TPFLAGS_BASETYPE from gdb.UnwindInfo
  gdb: have value_as_address call unpack_pointer
  gdb/python: Allow gdb.UnwindInfo to be created with non gdb.Value args
  gdb/python: Add new gdb.unwinder.FrameId class

 gdb/NEWS                               |  43 +++
 gdb/doc/python.texi                    | 212 +++++++++---
 gdb/python/lib/gdb/unwinder.py         |  49 ++-
 gdb/python/py-frame.c                  |   8 +-
 gdb/python/py-unwind.c                 | 456 ++++++++++++++++++++-----
 gdb/testsuite/gdb.python/py-unwind.exp | 216 +++++++++++-
 gdb/testsuite/gdb.python/py-unwind.py  | 156 ++++++++-
 gdb/value.c                            |   9 +-
 8 files changed, 996 insertions(+), 153 deletions(-)


base-commit: 6a208145d24c47912c8beb4f1f4b9abeb8d51134
  

Comments

Tom Tromey March 29, 2023, 4:27 p.m. UTC | #1
>>>>> "Andrew" == Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> writes:

Andrew> For <reasons> I ended up writing a small project using GDB's Unwinder
Andrew> Python API.  Though I could do everything I wanted, GDB's
Andrew> documentation in this area seemed a little lacking.

Andrew> So I started out just planning to cleanup the docs.

Andrew> But based on my experiences using the API, and after reading the docs
Andrew> through a couple of times, it felt like there were some small
Andrew> improvements that could be made to the API to make the lives of users
Andrew> easier.

Andrew> This series doesn't make any real changes to the API, but after this
Andrew> series the docs should be more complete, and the API a little more
Andrew> robust and easier to use.

Andrew> Oh, and tests.  Lots more tests.

FWIW, I read through these and it all looked reasonable to me.

Reviewed-By: Tom Tromey <tom@tromey.com>

thanks,
Tom