From: Tom Tromey <tom@tromey.com>
To: Simon Marchi <simark@simark.ca>
Cc: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/4] Change evpy_emit_event to accept a gdbpy_opt_borrowed_ref
Date: Mon, 14 Sep 2026 11:42:25 -0600 [thread overview]
Message-ID: <87qzivwwzi.fsf@tromey.com> (raw)
In-Reply-To: <8c6dadb8-d305-4df8-b5ac-42c15a34b734@simark.ca> (Simon Marchi's message of "Mon, 14 Sep 2026 11:42:47 -0400")
Simon> Copying a review comment from Claude that seems important:
Simon> - gdb/python/py-event.c:88: PyObject_CallFunctionObjArgs (func, event,
Simon> NULL) — event is now a gdbpy_opt_borrowed_ref<> and sits in the ...
FWIW I looked at all other calls to PyObject_CallFunctionObjArgs and
they are currently safe.
When moving this code more fully to the "safety" API, I think we can
replace this varargs call with a template function that knows how to
turn arguments into 'PyObject *', making it more safe.
Arguably maybe gdbpy_opt_borrowed_ref should only be accepted as the
final argument since a null value terminates the arguments. Or maybe we
should replace this with a check at the caller; which is slightly less
efficient but also maybe more clear.
Tom
next prev parent reply other threads:[~2026-09-14 17:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-08 21:47 [PATCH 0/4] Use gdbpy_borrowed_ref more + cast removal Tom Tromey
2026-08-08 21:47 ` [PATCH 1/4] Change evpy_emit_event to accept a gdbpy_opt_borrowed_ref Tom Tromey
2026-09-14 15:42 ` Simon Marchi
2026-09-14 16:59 ` Tom Tromey
2026-09-14 19:58 ` Simon Marchi
2026-09-14 17:42 ` Tom Tromey [this message]
2026-09-14 18:27 ` 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-09-14 15:46 ` Simon Marchi
2026-08-08 21:47 ` [PATCH 4/4] Remove unneeded casts to PyObject* Tom Tromey
2026-09-14 15:48 ` [PATCH 0/4] Use gdbpy_borrowed_ref more + cast removal Simon Marchi
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=87qzivwwzi.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/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