Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add experimental option --enable-py-limited-api
@ 2025-10-14 16:44 Matthieu Longo
  2025-10-14 16:44 ` [PATCH v2 1/2] gdb: make Python conftest compatible with Python limited C API Matthieu Longo
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Matthieu Longo @ 2025-10-14 16:44 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey, Andrew Burgess, Matthieu Longo

This patch series introduces an experimental build option, '--enable-py-limited-api', which allows GDB to be compiled against the Python 3 stable C API.

As explained in [1] and [2], using the stable API would make it possible to build GDB against one version of Python 3, while still allowing it to run with other versions available on the user's system.

The migration to the stable API can be done incrementally. These patches do not attempt to port the entire codebase at once. Instead, they provide a development mode where contributors can experiment with the limited API and progressively fix incompatibilities. By default, this option is disabled (--enable-py-limited-api=no).

The series contains two patches:
- Update the Python conftest to avoid use of unstable API calls, ensuring compatibility with the limited API.
- Introduce the --enable-py-limited-api option in GDB's configure.

Tested with Python 3.4 and 3.13.

Diff against revision 1:
- addressed comments of Tom Tromey regarding code formatting, and removal of config.h

Regards,
Matthieu

[1] PR gdb/23830
    https://sourceware.org/bugzilla/show_bug.cgi?id=23830
[2] [RFC] Allowing GDB to use a more recent version of Python at runtime than it was compiled with
    https://inbox.sourceware.org/gdb/314abf0a-007c-457d-bcc3-c28384b9f098@arm.com/


Matthieu Longo (2):
  gdb: make Python conftest compatible with Python limited C API
  gdb: add experimental option --enable-py-limited-api

 gdb/config.in    |  3 +++
 gdb/configure    | 47 ++++++++++++++++++++++++++++++++++++++++++-----
 gdb/configure.ac | 29 ++++++++++++++++++++++++++---
 3 files changed, 71 insertions(+), 8 deletions(-)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-10-20 15:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-14 16:44 [PATCH v2 0/2] Add experimental option --enable-py-limited-api Matthieu Longo
2025-10-14 16:44 ` [PATCH v2 1/2] gdb: make Python conftest compatible with Python limited C API Matthieu Longo
2025-10-14 16:44 ` [PATCH v2 2/2] gdb: add experimental option --enable-py-limited-api Matthieu Longo
2025-10-20 15:23   ` [PATCH] Drop bashism from configure script Kévin Le Gouguec
2025-10-20 15:31     ` Tom Tromey
2025-10-20 15:46       ` Kévin Le Gouguec
2025-10-14 17:22 ` [PATCH v2 0/2] Add experimental option --enable-py-limited-api Eli Zaretskii
2025-10-15  9:03   ` Matthieu Longo
2025-10-15 14:01 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox