]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite: add a test to check for Python traits static_assert
authorAndrew Burgess <aburgess@redhat.com>
Thu, 14 May 2026 16:47:01 +0000 (17:47 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Sat, 16 May 2026 12:21:19 +0000 (13:21 +0100)
commit4367b2d0bca4e9555502e28df42bd1bb31761776
tree61decfb116f84e3a5fc80a8835fcf51662b9fcab
parente7fce05fcf47c487b4f996f08a68f5818d1d41ca
gdb/testsuite: add a test to check for Python traits static_assert

The previous two commits added a new type trait which can be used
within a static_assert to check the properties of a struct used by GDB
to implement Python objects.

The previous commit fixed a bug in GDB which this trait check exposed.

This commit adds a new test gdb.gdb/python-traits-check.exp which
checks that every struct in the Python/ directory that inherits from
PyObject, has a suitable static_assert in place.

Adding this test should mean that if someone adds a new Python object
type to GDB, and they forget to add the static_assert, then this test
should give a failure, which should remind them to add the required
static_assert.  The static_assert will then check that their new
struct is compliant.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.gdb/python-traits-check.exp [new file with mode: 0644]