Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v1 0/4] gdb/python: more fixes again for Python limited C API support
@ 2026-04-09 10:51 Matthieu Longo
  2026-04-09 10:51 ` [PATCH v1 1/4] gdb/python: add gdbpy_borrowed_ref Matthieu Longo
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Matthieu Longo @ 2026-04-09 10:51 UTC (permalink / raw)
  To: gdb-patches, Tom Tromey; +Cc: Matthieu Longo

This patch series fixes more issues encountered while enabling the Python limited C API in GDB. This is probably the last relatively-small patch series before the Python C extension types migration to the limited API.

Patch 1 reuses a previous patch publised by Tom Tromey [1], with additional modifications that are required for its usage in the Python C extension types migration.
Patch 2 adapts the signature of eval_python_command() to return both the exit code and the result.
Patch 3 migrates Python initialization to use the new config API (PEP 741) introduced by Python 3.14. Old code is preserved for older versions of Python.
Patch 4 proposes a workaround for the missing symbols not yet part of the limited API. Thanks to it, I was able to finish the compilation of GDB using the limited C API and run all the Python tests successfully.

All changes were tested by building GDB against the unlimited API of Python 3.10, 3.11, 3.12, 3.13 and 3.14, and the limited API of Python 3.14 (no build regression), and no regressions were observed in the testsuite.

Regards,
Matthieu

[1]: https://inbox.sourceware.org/gdb-patches/20260222200759.1587070-2-tom@tromey.com/


Matthieu Longo (3):
  gdb/python: eval_python_command returns both exit code and result
  gdb/python: migrate Python initialization to use the new config API (PEP 741)
  gdb/python: work around missing symbols not yet part of Python limited API

Tom Tromey (1):
  gdb/python: add gdbpy_borrowed_ref

 gdb/python/py-gdb-readline.c            |   3 +-
 gdb/python/py-ref.h                     | 114 +++++++++++++++
 gdb/python/python-internal.h            |   7 +-
 gdb/python/python-limited-api-missing.h |  62 ++++++++
 gdb/python/python.c                     | 182 ++++++++++++++++++++----
 gdb/varobj.c                            |  12 +-
 6 files changed, 341 insertions(+), 39 deletions(-)
 create mode 100644 gdb/python/python-limited-api-missing.h

-- 
2.53.0


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

end of thread, other threads:[~2026-04-15  9:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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-09 10:51 ` [PATCH v1 2/4] gdb/python: eval_python_command returns both exit code and result 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-09 10:51 ` [PATCH v1 4/4] gdb/python: work around missing symbols not yet part of Python limited API Matthieu Longo
2026-04-15  9:18 ` [PATCH v1 0/4] gdb/python: more fixes again for Python limited C API support Matthieu Longo

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