[0/5] New Python hook for missing debug information

Message ID cover.1697626088.git.aburgess@redhat.com
Headers
Series New Python hook for missing debug information |

Message

Andrew Burgess Oct. 18, 2023, 10:53 a.m. UTC
  This series adds a new Python hook to GDB, this hook allows a user to
register a handler object which will be called whenever GDB fails to
locate any debug information for an objfile it is loading.  These
handler objects can (potentially) perform host or project specific
actions to help GDB locate the missing debug information.

Commits #1 and #2 are refactoring.  These merge the separate debug
information lookup code from coffread.c and elfread.c.

Commit #3 is more refactoring, this simplifies the now merged code.

Commit #4 implements the framework for the new hook within GDB, but
doesn't implement the Python side of things yet.

Commit #5 is where I add the Python side of things, it's only at this
point that a user can actually hook into GDB.

---

Andrew Burgess (5):
  gdb/coffread: bring separate debug file logic into line with elfread.c
  gdb: merge debug symbol file lookup code from coffread & elfread paths
  gdb: refactor objfile::find_and_add_separate_symbol_file
  gdb: add an extension language hook for missing debug info
  gdb: implement missing debug handler hook for Python

 gdb/NEWS                                      |  26 +
 gdb/coffread.c                                |  28 +-
 gdb/data-directory/Makefile.in                |   2 +
 gdb/doc/python.texi                           | 136 +++++
 gdb/elfread.c                                 |  57 +--
 gdb/extension-priv.h                          |   7 +
 gdb/extension.c                               |  19 +
 gdb/extension.h                               |  62 +++
 gdb/objfiles.h                                |  10 +
 gdb/python/lib/gdb/__init__.py                |  41 ++
 gdb/python/lib/gdb/command/missing_debug.py   | 226 +++++++++
 gdb/python/lib/gdb/missing_debug.py           | 169 +++++++
 gdb/python/py-progspace.c                     |  51 ++
 gdb/python/python.c                           |  83 ++-
 gdb/symfile-debug.c                           | 154 ++++++
 gdb/testsuite/gdb.python/py-missing-debug.c   |  22 +
 gdb/testsuite/gdb.python/py-missing-debug.exp | 473 ++++++++++++++++++
 gdb/testsuite/gdb.python/py-missing-debug.py  | 120 +++++
 18 files changed, 1608 insertions(+), 78 deletions(-)
 create mode 100644 gdb/python/lib/gdb/command/missing_debug.py
 create mode 100644 gdb/python/lib/gdb/missing_debug.py
 create mode 100644 gdb/testsuite/gdb.python/py-missing-debug.c
 create mode 100644 gdb/testsuite/gdb.python/py-missing-debug.exp
 create mode 100644 gdb/testsuite/gdb.python/py-missing-debug.py


base-commit: 5d4a870e05ac45e3f5a301c672a4079995b5db7a