[0/2] Cleanup in Python frame_object

Message ID cover.1780393815.git.aburgess@redhat.com
Headers
Series Cleanup in Python frame_object |

Message

Andrew Burgess June 2, 2026, 9:54 a.m. UTC
  While working on another patch I ran into an issue with Python's frame
handling, this got me looking at how Python holds a frame's id.

GDB's frame-id handling has evolved since the Python frame related
code was added, and I think we can now clean up the Python code, and
fix a small bug in the process.

Patch #1 is a small testsuite cleanup.

Patch #2 is the actual change to the Python code, updates to the
expected output for a couple of tests, and a new test that exposes the
bug.

Thanks,
Andrew

---

Andrew Burgess (2):
  gdb/testsuite: don't overwrite test executable in py-frame.exp
  gdb/python: remove frame_object::frame_id_is_next as unnecessary

 gdb/python/py-frame.c                         |  33 +---
 gdb/testsuite/gdb.python/py-frame.exp         |  36 +++-
 gdb/testsuite/gdb.python/py-frame.py          | 187 ++++++++++++++++++
 .../gdb.python/py-pending-frame-level.exp     |   2 +-
 gdb/testsuite/gdb.python/py-unwind.exp        |   4 +-
 5 files changed, 227 insertions(+), 35 deletions(-)
 create mode 100644 gdb/testsuite/gdb.python/py-frame.py


base-commit: f577746edb4ca2678f69feb5e5848a646d5cd856
  

Comments

Andrew Burgess July 8, 2026, 12:51 p.m. UTC | #1
Andrew Burgess <aburgess@redhat.com> writes:

> While working on another patch I ran into an issue with Python's frame
> handling, this got me looking at how Python holds a frame's id.
>
> GDB's frame-id handling has evolved since the Python frame related
> code was added, and I think we can now clean up the Python code, and
> fix a small bug in the process.
>
> Patch #1 is a small testsuite cleanup.
>
> Patch #2 is the actual change to the Python code, updates to the
> expected output for a couple of tests, and a new test that exposes the
> bug.
>

I've gone ahead and checked this in.  Let me know if any issues show
up.

Thanks,
Andrew