[0/4] More build-id checking when opening core files

Message ID cover.1715955328.git.aburgess@redhat.com
Headers
Series More build-id checking when opening core files |

Message

Andrew Burgess May 17, 2024, 2:18 p.m. UTC
  This series start with patch #3.  I wanted to improve the build-id
checking that GDB does when loading shared libraries as part of
opening a core file, I found the existing build-id checks to be rather
limited.

To write #3 I ended up looking at the mapped file handling in
corelow.c, which lead to patches #1 and #2.

And patch #4 appeared when I observed that we do similar, but slightly
different things in 3 places in GDB, and these could all be merged.

---

Andrew Burgess (4):
  gdb/corefile: remove unavailable target sections
  gdb/corefile: improve file backed mapping handling
  gdb: improve shared library build-id check for core-files
  gdb: unify build-id to objfile lookup code

 gdb/build-id.c                                |  42 +-
 gdb/build-id.h                                |  21 +-
 gdb/corelow.c                                 | 379 +++++++++++++-----
 gdb/solib-aix.c                               |   6 +
 gdb/solib-darwin.c                            |   6 +
 gdb/solib-dsbt.c                              |   6 +
 gdb/solib-frv.c                               |   6 +
 gdb/solib-svr4.c                              |  10 +
 gdb/solib-target.c                            |   6 +
 gdb/solib.c                                   | 369 ++++++++++++++---
 gdb/solib.h                                   |  39 +-
 gdb/solist.h                                  |  22 +
 gdb/testsuite/gdb.base/corefile.exp           |  39 ++
 gdb/testsuite/gdb.base/solib-search.exp       |   6 +-
 .../gdb.debuginfod/corefile-mapped-file-1.c   |  24 ++
 .../gdb.debuginfod/corefile-mapped-file-2.c   |  22 +
 .../gdb.debuginfod/corefile-mapped-file-3.c   |  45 +++
 .../gdb.debuginfod/corefile-mapped-file.exp   | 335 ++++++++++++++++
 .../gdb.debuginfod/solib-with-soname-1.c      |  39 ++
 .../gdb.debuginfod/solib-with-soname-2.c      |  41 ++
 .../gdb.debuginfod/solib-with-soname.exp      | 268 +++++++++++++
 gdb/testsuite/lib/gdb.exp                     |  20 +-
 22 files changed, 1587 insertions(+), 164 deletions(-)
 create mode 100644 gdb/testsuite/gdb.debuginfod/corefile-mapped-file-1.c
 create mode 100644 gdb/testsuite/gdb.debuginfod/corefile-mapped-file-2.c
 create mode 100644 gdb/testsuite/gdb.debuginfod/corefile-mapped-file-3.c
 create mode 100644 gdb/testsuite/gdb.debuginfod/corefile-mapped-file.exp
 create mode 100644 gdb/testsuite/gdb.debuginfod/solib-with-soname-1.c
 create mode 100644 gdb/testsuite/gdb.debuginfod/solib-with-soname-2.c
 create mode 100644 gdb/testsuite/gdb.debuginfod/solib-with-soname.exp


base-commit: ad666becfe075ca7c831ebbf4b44526994395e97