Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v2 0/6] gdb: minor fixes for Python limited C API support
@ 2026-01-27 17:02 Matthieu Longo
  2026-01-27 17:02 ` [PATCH v2 1/6] Python limited API: migrate Py_CompileStringExFlags and PyRun_SimpleString Matthieu Longo
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Matthieu Longo @ 2026-01-27 17:02 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey, Matthieu Longo

This patch series fixes a set of minor issues encountered while enabling the Python limited C API in GDB, and starts preparing the ground for migrating the existing C extension types from static types to heap-allocated ones, by removing the dependency on tp_dictoffset, which is unavailable when using the limited API. Those fixes were accumulated during the migration work, and are intentionally split out from an upcoming larger patch series. The first three patches in the series are small, and self-contained fixes. The next three ones continue the work undertaken in the third one, and have a dependency on previous patches.

All changes were tested by building GDB against the limited API and unlimited API, and no regressions were observed in the testsuite.

# Revision 1 -> 2

Patch series v1: https://inbox.sourceware.org/gdb-patches/20260107165606.1719366-1-matthieu.longo@arm.com
Major changes since the last revision:
 - addressed minor comments on patch 1 and 2.
 - patch 3: inherits from PyObject.
New:
 - patch 4: inherits from PyObject, but also had to provide a different approach to provide a dict because offsetof does not work anymore with inheritance. Anyway, this had to be fixed so two birds with one stone.
 - patch 5: enforces that the template type is a subclass of PyObject in gdbpy_ref_policy.
 - patch 6: finish migrating all the remaing declarations.

Regards,
Matthieu


Matthieu Longo (6):
  Python limited API: migrate Py_CompileStringExFlags and PyRun_SimpleString
  Python limited API: migrate PyImport_ExtendInittab
  gdbpy_registry: cast C extension type object to PyObject * before Py_XINCREF
  gdb: new setters and getters for __dict__, and attributes
  gdb: cast all Python extension objects passed to gdbpy_ref_policy to PyObject*
  gdb: make remaining Python extension objects inherit from PyObject

 gdb/python/py-arch.c          |  4 +-
 gdb/python/py-block.c         |  8 +--
 gdb/python/py-breakpoint.c    |  4 +-
 gdb/python/py-cmd.c           |  4 +-
 gdb/python/py-color.c         |  4 +-
 gdb/python/py-connection.c    |  4 +-
 gdb/python/py-corefile.c      | 26 +++-------
 gdb/python/py-disasm.c        | 16 ++----
 gdb/python/py-event.c         | 10 ++--
 gdb/python/py-event.h         |  8 +--
 gdb/python/py-events.h        |  4 +-
 gdb/python/py-frame.c         |  4 +-
 gdb/python/py-gdb-readline.c  |  5 +-
 gdb/python/py-inferior.c      | 29 ++---------
 gdb/python/py-infthread.c     | 10 ++--
 gdb/python/py-instruction.c   |  5 +-
 gdb/python/py-lazy-string.c   |  5 +-
 gdb/python/py-linetable.c     | 12 ++---
 gdb/python/py-membuf.c        |  5 +-
 gdb/python/py-micmd.c         |  4 +-
 gdb/python/py-objfile.c       | 18 +++----
 gdb/python/py-param.c         |  4 +-
 gdb/python/py-prettyprint.c   |  6 +--
 gdb/python/py-progspace.c     | 18 +++----
 gdb/python/py-record-btrace.c |  5 +-
 gdb/python/py-record.c        |  4 +-
 gdb/python/py-record.h        |  8 +--
 gdb/python/py-ref.h           | 47 ++++++++++++++++-
 gdb/python/py-registers.c     | 20 +++-----
 gdb/python/py-style.c         |  4 +-
 gdb/python/py-symbol.c        |  4 +-
 gdb/python/py-symtab.c        |  8 +--
 gdb/python/py-tui.c           |  4 +-
 gdb/python/py-type.c          | 26 ++++------
 gdb/python/py-unwind.c        |  8 +--
 gdb/python/py-utils.c         | 95 +++++++++++++++++++++++++++++++----
 gdb/python/py-value.c         |  4 +-
 gdb/python/python-internal.h  | 47 ++++++++++++-----
 gdb/python/python.c           | 27 ++++------
 39 files changed, 281 insertions(+), 247 deletions(-)

-- 
2.52.0


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

end of thread, other threads:[~2026-01-28 17:51 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-27 17:02 [PATCH v2 0/6] gdb: minor fixes for Python limited C API support Matthieu Longo
2026-01-27 17:02 ` [PATCH v2 1/6] Python limited API: migrate Py_CompileStringExFlags and PyRun_SimpleString Matthieu Longo
2026-01-27 17:54   ` Tom Tromey
2026-01-27 17:02 ` [PATCH v2 2/6] Python limited API: migrate PyImport_ExtendInittab Matthieu Longo
2026-01-27 17:54   ` Tom Tromey
2026-01-27 17:02 ` [PATCH v2 3/6] gdbpy_registry: cast C extension type object to PyObject * before Py_XINCREF Matthieu Longo
2026-01-27 18:01   ` Tom Tromey
2026-01-27 18:29   ` Tom Tromey
2026-01-28 11:58     ` Matthieu Longo
2026-01-27 17:02 ` [PATCH v2 4/6] gdb: new setters and getters for __dict__, and attributes Matthieu Longo
2026-01-27 19:06   ` Tom Tromey
2026-01-28 11:57     ` Matthieu Longo
2026-01-28 17:43     ` Matthieu Longo
2026-01-28 17:51       ` Tom Tromey
2026-01-27 17:02 ` [PATCH v2 5/6] gdb: cast all Python extension objects passed to gdbpy_ref_policy to PyObject* Matthieu Longo
2026-01-27 18:28   ` Tom Tromey
2026-01-28 11:58     ` Matthieu Longo
2026-01-27 17:02 ` [PATCH v2 6/6] gdb: make remaining Python extension objects inherit from PyObject Matthieu Longo
2026-01-27 18:29   ` Tom Tromey
2026-01-28 11:58     ` Matthieu Longo

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