[0/5] Better executable auto-loading when opening a core file

Message ID cover.1729940786.git.aburgess@redhat.com
Headers
Series Better executable auto-loading when opening a core file |

Message

Andrew Burgess Oct. 26, 2024, 11:11 a.m. UTC
  There's actually a couple of core file related improvements in this
series.

Patches #1 and #2 improve what information GDB can extract about the
execution context (executable name, inferior arguments, and
environment) when opening a core file.

Then patch #4 improves GDB's ability to auto-load the executable that
matches a core file (on GNU/Linux).

Patch #3 is a testsuite refactor to allow for patch #4.

And patch #5 replicates patch #4, but for FreeBSD.

Thanks,
Andrew

---

Andrew Burgess (5):
  gdb: add gdbarch method to get execution context from core file
  gdb: parse and set the inferior environment from core files
  gdb/testsuite: make some of the core file / build-id tests harder
  gdb: improve GDB's ability to auto-load the exec for a core file
  gdb/freebsd: port core file context parsing to FreeBSD

 gdb/arch-utils.c                              |  26 ++
 gdb/arch-utils.h                              |  89 +++++
 gdb/corefile.c                                |  10 +
 gdb/corelow.c                                 | 172 +++++++++-
 gdb/fbsd-tdep.c                               | 134 ++++++++
 gdb/gdbarch-gen.c                             |  22 ++
 gdb/gdbarch-gen.h                             |  15 +
 gdb/gdbarch.h                                 |   1 +
 gdb/gdbarch_components.py                     |  20 ++
 gdb/linux-tdep.c                              | 308 ++++++++++++++++++
 gdb/testsuite/gdb.base/coredump-filter.exp    |  17 +-
 gdb/testsuite/gdb.base/corefile-buildid.exp   | 252 ++++++--------
 .../gdb.base/corefile-exec-context.c          |  25 ++
 .../gdb.base/corefile-exec-context.exp        | 165 ++++++++++
 gdb/testsuite/gdb.base/corefile-find-exec.c   |  25 ++
 gdb/testsuite/gdb.base/corefile-find-exec.exp | 252 ++++++++++++++
 gdb/testsuite/gdb.base/corefile.exp           |   9 +
 17 files changed, 1379 insertions(+), 163 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/corefile-exec-context.c
 create mode 100644 gdb/testsuite/gdb.base/corefile-exec-context.exp
 create mode 100644 gdb/testsuite/gdb.base/corefile-find-exec.c
 create mode 100644 gdb/testsuite/gdb.base/corefile-find-exec.exp


base-commit: 2bba46058789196c1c384896933cbc9692ef4933