Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 3/3] gdb/testsuite: add a test to check for Python traits static_assert
Date: Sat, 16 May 2026 13:29:42 +0100	[thread overview]
Message-ID: <87fr3rczbd.fsf@redhat.com> (raw)
In-Reply-To: <87lddkh952.fsf@tromey.com>

Tom Tromey <tom@tromey.com> writes:

>>>>>> "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.

ACK. As with patch #1, once there's a better way, and the static_asserts
are no longer of value, I'm happy for this patch to be reverted.  But
for now, while it adds some value, I've gone ahead and checked it in.

Thanks for reviewing this series,
Andrew


>
> Approved-By: Tom Tromey <tom@tromey.com>
>
> Tom


      reply	other threads:[~2026-05-16 12:30 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
2026-05-16 12:29     ` Andrew Burgess [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=87fr3rczbd.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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