From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess <aburgess@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 3/3] gdb/testsuite: add a test to check for Python traits static_assert
Date: Fri, 15 May 2026 11:31:37 -0600 [thread overview]
Message-ID: <87lddkh952.fsf@tromey.com> (raw)
In-Reply-To: <93b625c0ab2f23cafa636d42e503361b70ee6edf.1778839043.git.aburgess@redhat.com> (Andrew Burgess's message of "Fri, 15 May 2026 11:00:48 +0100")
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
Andrew> The previous two commits added a new type trait which can be used
Andrew> within a static_assert to check the properties of a struct used by GDB
Andrew> to implement Python objects.
Andrew> The previous commit fixed a bug in GDB which this trait check exposed.
Andrew> This commit adds a new test gdb.gdb/python-traits-check.exp which
Andrew> checks that every struct in the Python/ directory that inherits from
Andrew> PyObject, has a suitable static_assert in place.
Andrew> Adding this test should mean that if someone adds a new Python object
Andrew> type to GDB, and they forget to add the static_assert, then this test
Andrew> should give a failure, which should remind them to add the required
Andrew> static_assert. The static_assert will then check that their new
Andrew> struct is compliant.
With the "safety" work we can have the compiler check this; or if the
tp_init plan works out, I guess just drop the requirement entirely.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
next prev parent reply other threads:[~2026-05-15 17:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 10:00 [PATCH 0/3] Use C++ type traits check to catch bugs in Python API Andrew Burgess
2026-05-15 10:00 ` [PATCH 1/3] gdb/python: add type traits check for all PyObject sub-classes Andrew Burgess
2026-05-15 17:10 ` Tom Tromey
2026-05-16 12:27 ` Andrew Burgess
2026-05-15 10:00 ` [PATCH 2/3] gdb/python: fix use of frame_info_ptr within pending_frame_object Andrew Burgess
2026-05-15 17:22 ` Tom Tromey
2026-05-16 12:28 ` Andrew Burgess
2026-05-15 10:00 ` [PATCH 3/3] gdb/testsuite: add a test to check for Python traits static_assert Andrew Burgess
2026-05-15 17:31 ` Tom Tromey [this message]
2026-05-16 12:29 ` Andrew Burgess
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=87lddkh952.fsf@tromey.com \
--to=tom@tromey.com \
--cc=aburgess@redhat.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