[PATCHv2 0/3] Core file Python API

Andrew Burgess
2025-09-23T13:47:54Z

In v2:

+ Patches 1 and 3 updated inline with Tom's feedback.
+ Rebased to current HEAD.
+ Retested.

This series extends the Python API to allow users to query the
currently loaded core file, and to find out things about the core
file.

There's probably more features we could offer, but I think this is a
reasonable starting point.

All feedback welcome.

Thanks,
Andrew

---

Andrew Burgess (3):
gdb/python: introduce gdb.Corefile API
gdb: make structured core file mappings processing global
gdb/python: add Corefile.mapped_files method

gdb/Makefile.in | 1 +
gdb/NEWS | 33 ++
gdb/corelow.c | 225 ++++----
gdb/doc/python.texi | 110 ++++
gdb/gdbcore.h | 43 ++
gdb/observable.c | 1 +
gdb/observable.h | 6 +
gdb/python/py-corefile.c | 688 +++++++++++++++++++++++
gdb/python/py-inferior.c | 18 +
gdb/python/python-internal.h | 8 +
gdb/testsuite/gdb.python/py-corefile.c | 25 +
gdb/testsuite/gdb.python/py-corefile.exp | 236 ++++++++
gdb/testsuite/gdb.python/py-corefile.py | 144 +++++
13 files changed, 1437 insertions(+), 101 deletions(-)
create mode 100644 gdb/python/py-corefile.c
create mode 100644 gdb/testsuite/gdb.python/py-corefile.c
create mode 100644 gdb/testsuite/gdb.python/py-corefile.exp
create mode 100644 gdb/testsuite/gdb.python/py-corefile.py

base-commit: 84dd63f3279dc0d1e13351dbc7b11261800e4758
--
2.47.1