From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 0/4] Use gdbpy_borrowed_ref more + cast removal
Date: Sat, 08 Aug 2026 15:47:24 -0600 [thread overview]
Message-ID: <20260808-python-safety-events-simple-v1-0-132aea40c801@tromey.com> (raw)
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 <tom@tromey.com>
---
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 <tom@tromey.com>
next reply other threads:[~2026-08-08 21:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-08 21:47 Tom Tromey [this message]
2026-08-08 21:47 ` [PATCH 1/4] Change evpy_emit_event to accept a gdbpy_opt_borrowed_ref Tom Tromey
2026-08-08 21:47 ` [PATCH 2/4] Change evpy_add_attribute to accept gdbpy_borrowed_ref Tom Tromey
2026-08-08 21:47 ` [PATCH 3/4] Use gdbpy_borrowed_ref when creating events Tom Tromey
2026-08-08 21:47 ` [PATCH 4/4] Remove unneeded casts to PyObject* Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260808-python-safety-events-simple-v1-0-132aea40c801@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox