[Bug python/23830] use the stable python 3 ABI

cvs-commit at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Fri May 15 10:13:02 GMT 2026


https://sourceware.org/bugzilla/show_bug.cgi?id=23830

--- Comment #19 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Matthieu Longo <mlongo@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=58f83d84710e37a36f2b8b6a6404f9904dc4ae88

commit 58f83d84710e37a36f2b8b6a6404f9904dc4ae88
Author: Matthieu Longo <matthieu.longo@arm.com>
Date:   Mon Mar 30 17:08:03 2026 +0100

    gdb/python: work around missing symbols not yet part of Python limited API

    Most Python API usages in GDB can be migrated to the limited API, except
    the following:

    - PEP-741's configuration structures and functions, which use opaque
      types. They were originally intended to be part of the Python limited
      API, but some Python core maintainers opposed their inclusion at the
      time.
    - PyOS_ReadlineFunctionPointer, a global variable storing a function
      used to override PyOS_StdioReadline(). The signature has remained
      unchanged for a long time.
    - PyRun_InteractiveLoop, used to read and execute Python statements when
      embedding an interactive interpreter. Its signature has also remained
      stable for a long time.

    Since no limited API alternatives exist for these, and given their long
    history of ABI stability, one approach is to expose them in a GDB header
    and rely on their continued stability. While this is not without risk,
    it seems acceptable given the arguments above. This would remove the
    remaining obstacles preventing GDB from being agnostic to the Python
    version available at runtime.
    That said, issues should be opened on CPython issue tracker to request
    that these functions be included in the limited API in future versions.
    Last but not least, GDB does not need to officially support the Python
    limited API. The '--enable-py-limited-api' option can remain experimental,
    with appropriate forewarnings about its limitations and guarantees.

    This patch adds a new header, python-limited-api-missing.h, which
    exposes symbols not yet part of the Python limited API.

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23830
    Approved-By: Tom Tromey <tom@tromey.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list