Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Matthieu Longo <matthieu.longo@arm.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v1 4/4] gdb/python: work around missing symbols not yet part of Python limited API
Date: Fri, 24 Apr 2026 11:14:42 +0100	[thread overview]
Message-ID: <3a96ab1c-5c69-47b8-9e26-cb1e756da96f@arm.com> (raw)
In-Reply-To: <87eckdsdl6.fsf@tromey.com>

On 17/04/2026 18:26, Tom Tromey wrote:
>>>>>> "Matthieu" == Matthieu Longo <matthieu.longo@arm.com> writes:
> 
> Matthieu> Since no limited API alternatives exist for these, and given their long
> Matthieu> history of ABI stability, one approach is to expose them in a GDB header
> Matthieu> and rely on their continued stability. While this is not without risk,
> Matthieu> it seems acceptable given the arguments above.
> 
> I'm not opposed to this at all but I wonder if there's some way we could
> arrange to check that this file doesn't get out of date.
> 

I don't see how we could do that.

However, we can make explicit the range of Python versions that are supported by this workaround header.
If GDB is compiled with the Python limited API enabled, and if CPython is a newer version that has 
never been tested, we could make it error so that someone has to publish a patch to update the range 
of supported versions in this file. It will force maintainers to look at this file for every new 
versions of CPython, and check whether there is any breaking change in the ABI.

> Like, is there some way we could have a file that includes both
> <Python.h> and this file but without defining Py_LIMITED_API?
> 

How would it help ?

> Or alternatively could we segregate the code that needs these APIs and
> compile that code without Py_LIMITED_API?  (Removing the need for this file?)

Moving gdb_PyInitializer into another CPP file and expose the class via the header is feasible.
For PyRun_InteractiveLoop() and PyOS_ReadlineFunctionPointer, it would be very awkward.

> > Tom

Matthieu

  reply	other threads:[~2026-04-24 10:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 10:51 [PATCH v1 0/4] gdb/python: more fixes again for Python limited C API support Matthieu Longo
2026-04-09 10:51 ` [PATCH v1 1/4] gdb/python: add gdbpy_borrowed_ref Matthieu Longo
2026-04-17 15:40   ` Tom Tromey
2026-04-23 17:31     ` Matthieu Longo
2026-04-09 10:51 ` [PATCH v1 2/4] gdb/python: eval_python_command returns both exit code and result Matthieu Longo
2026-04-17 17:22   ` Tom Tromey
2026-04-23 19:11     ` Matthieu Longo
2026-04-09 10:51 ` [PATCH v1 3/4] gdb/python: migrate Python initialization to use the new config API (PEP 741) Matthieu Longo
2026-04-17 15:53   ` Tom Tromey
2026-04-24  9:41     ` Matthieu Longo
2026-04-24 14:56       ` Tom Tromey
2026-04-27 15:12         ` Matthieu Longo
2026-04-28 14:44           ` Tom Tromey
2026-04-09 10:51 ` [PATCH v1 4/4] gdb/python: work around missing symbols not yet part of Python limited API Matthieu Longo
2026-04-17 17:26   ` Tom Tromey
2026-04-24 10:14     ` Matthieu Longo [this message]
2026-04-15  9:18 ` [PATCH v1 0/4] gdb/python: more fixes again for Python limited C API support Matthieu Longo

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=3a96ab1c-5c69-47b8-9e26-cb1e756da96f@arm.com \
    --to=matthieu.longo@arm.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