[PATCH 0/4] Use gdbpy_borrowed_ref more + cast removal
Tom Tromey <[email protected]>
| Newsgroups | gmane.comp.gdb.patches |
|---|---|
| Message-ID | <20260808-python-safety-events-simple-v1-0-132aea40c801@tromey.com> |
This started as a series to clean up event generation a little. Long term I'd like to migrate all of this to the safe API; but in the meantime this just arranges to use gdbpy_borrowed_ref some more. This lets us remove calls to "get", which seems nice even on its own. While doing this I noticed many unnecessary casts, so I've added a patch to remove these as well. Signed-off-by: Tom Tromey <[email protected]> --- Tom Tromey (4): Change evpy_emit_event to accept a gdbpy_opt_borrowed_ref Change evpy_add_attribute to accept gdbpy_borrowed_ref Use gdbpy_borrowed_ref when creating events Remove unneeded casts to PyObject* gdb/python/py-arch.c | 2 +- gdb/python/py-block.c | 2 +- gdb/python/py-bpevent.c | 10 ++++------ gdb/python/py-breakpoint.c | 24 +++++++++--------------- gdb/python/py-cmd.c | 8 ++++---- gdb/python/py-connection.c | 4 ++-- gdb/python/py-continueevent.c | 4 ++-- gdb/python/py-corefile.c | 11 +++++------ gdb/python/py-disasm.c | 13 ++++++------- gdb/python/py-event.c | 5 +++-- gdb/python/py-event.h | 13 +++++++++---- gdb/python/py-evts.c | 4 +--- gdb/python/py-exitedevent.c | 10 ++++------ gdb/python/py-finishbreakpoint.c | 7 +++---- gdb/python/py-inferior.c | 31 +++++++++++++------------------ gdb/python/py-infevents.c | 18 +++++++++--------- gdb/python/py-infthread.c | 2 +- gdb/python/py-lazy-string.c | 2 +- gdb/python/py-linetable.c | 4 ++-- gdb/python/py-membuf.c | 2 +- gdb/python/py-micmd.c | 2 +- gdb/python/py-newobjfileevent.c | 19 ++++++++----------- gdb/python/py-objfile.c | 7 +++---- gdb/python/py-progspace.c | 15 ++++++--------- gdb/python/py-record-btrace.c | 2 +- gdb/python/py-record.c | 10 +++++----- gdb/python/py-registers.c | 4 ++-- gdb/python/py-signalevent.c | 5 ++--- gdb/python/py-stopevent.c | 9 ++++----- gdb/python/py-stopevent.h | 7 ++++--- gdb/python/py-threadevent.c | 10 ++++------ gdb/python/py-tui.c | 6 +++--- gdb/python/py-type.c | 6 +++--- gdb/python/py-unwind.c | 12 +++++------- gdb/python/python.c | 4 ++-- 35 files changed, 134 insertions(+), 160 deletions(-) --- base-commit: c7c7858871f77bb265bbce492d39716f39e0d462 change-id: 20260808-python-safety-events-simple-1a281b2c6dbf Best regards, -- Tom Tromey <[email protected]>