From: Tom Tromey <tom@tromey.com>
To: Tom de Vries <tdevries@suse.de>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] [gdb/python] Convert valpy_call to the "python safety" approach
Date: Fri, 14 Aug 2026 14:26:34 -0600 [thread overview]
Message-ID: <87cxvkv479.fsf@tromey.com> (raw)
In-Reply-To: <20260810115236.1087432-1-tdevries@suse.de> (Tom de Vries's message of "Mon, 10 Aug 2026 13:52:36 +0200")
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> I added wrapper function gdbpy_tuple_check to wrap PyTuple_Check. It always
Tom> succeeds, so strictly speaking it doesn't need a wrapper, but always using
Tom> wrapper functions and trusting them to DDRT is easier than remembering which
Tom> functions always succeed.
Seems reasonable.
Tom> I also added this template:
Tom> ...
Tom> template<typename T>
Tom> T
Tom> gdbpy_require_nonnull (T val)
Tom> {
Tom> if (val == nullptr)
Tom> throw gdb_python_exception ();
Tom> return val;
Tom> }
Tom> ...
Tom> to do this simplification:
This also seems fine, though in the longer run we should be removing
this function again.
Tom> +gdbpy_ref<>
Tom> +value_object::valpy_call (gdbpy_borrowed_ref<> args,
Tom> + gdbpy_opt_borrowed_ref<> keywords ATTRIBUTE_UNUSED)
Not too sure about that ATTRIBUTE_UNUSED.
Like, if we don't need it, we should support a different signature
elsewhere.
Tom> + safety_details::varargs_wrapper<value_object, &value_object::valpy_call>, /*tp_call*/
I think code outside py-safety.h should not refer to the contents of the
safety_details namespace.
Tom
prev parent reply other threads:[~2026-08-14 20:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 11:52 Tom de Vries
2026-08-14 20:26 ` Tom Tromey [this message]
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=87cxvkv479.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/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