From: Matthieu Longo <matthieu.longo@arm.com>
To: <gdb-patches@sourceware.org>
Cc: Tom Tromey <tom@tromey.com>, Andrew Burgess <aburgess@redhat.com>,
Matthieu Longo <matthieu.longo@arm.com>
Subject: [PATCH v2 0/2] Add experimental option --enable-py-limited-api
Date: Tue, 14 Oct 2025 17:44:56 +0100 [thread overview]
Message-ID: <20251014164458.2000229-1-matthieu.longo@arm.com> (raw)
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
next reply other threads:[~2025-10-14 16:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 16:44 Matthieu Longo [this message]
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
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=20251014164458.2000229-1-matthieu.longo@arm.com \
--to=matthieu.longo@arm.com \
--cc=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