[PATCHv4,0/7] Fixes related to misplaced symtabs originating from dwz files

Message ID cover.1767024363.git.aburgess@redhat.com
Headers
Series Fixes related to misplaced symtabs originating from dwz files |

Message

Andrew Burgess Dec. 29, 2025, 4:15 p.m. UTC
  The test that appears in v1 and v2 of this series can still be found
as patch #6 in this new series.  However, this new series proposes a
fix for the underlying issue in patch #7.

The patches #1,#2, #3, #5, and #5, are some light refactoring that
makes the fix, found in patch #7 easier.

I'm aware that the patch description on #6 is rather long.  The
underlying issue has a lot of parts that all came together to reveal
the bug, and it's not helped that the bug I originally ran into has
been mitigated, but not fixed, by a recent patch.  In some ways you
might be better off jumping ahead to patch #7 which focuses on the
underlying issue then going back to #6, where debuginfod is also added
into the mix, to understand the original issue that I ran into.

In V4:

  - Added patches #2, #3, and #5 based on Simon's review feedback.
    These don't really change anything related to the test or fix (in
    patches #6 and #7), but are similar in spirit to the refactoring
    that I was already proposing.  I can understand why Simon
    suggested making these changes.

    That said, patches #1 to #5 are all just refactoring and can be
    reviewed almost independently to the last two patches in the
    series.

Thanks,
Andrew

---

Andrew Burgess (7):
  gdb/dwarf: remove line_header parameter from dwarf2_decode_lines
  gdb/dwarf: remove m_line_header from lnp_state_machine class
  gdb/dwarf: remove the line_header argument from dwarf2_start_subfile
  gdb/dwarf: move subfile and symtab creation into dwarf2_cu method
  gdb/dwarf: rename dwarf2_start_subfile to dwarf2_cu::start_subfile
  gdb: test for misplaced symtab causing file not found error
  gdb: avoid creating misplaced symtabs for dwz files

 gdb/dwarf2/cu.c                               |  40 ++
 gdb/dwarf2/cu.h                               |   7 +
 gdb/dwarf2/line-header.c                      |  23 ++
 gdb/dwarf2/line-header.h                      |  13 +-
 gdb/dwarf2/line-program.c                     |  90 ++---
 gdb/dwarf2/line-program.h                     |  10 +-
 gdb/dwarf2/read.c                             |  57 +--
 gdb/dwarf2/read.h                             |  25 --
 gdb/testsuite/gdb.base/dwz-symtabs-bar.c      |  36 ++
 gdb/testsuite/gdb.base/dwz-symtabs-bar.h      |  25 ++
 gdb/testsuite/gdb.base/dwz-symtabs-common.h   |  32 ++
 gdb/testsuite/gdb.base/dwz-symtabs-foo.c      |  79 ++++
 gdb/testsuite/gdb.base/dwz-symtabs-foo.h      |  27 ++
 gdb/testsuite/gdb.base/dwz-symtabs-main.c     |  34 ++
 gdb/testsuite/gdb.base/dwz-symtabs.exp        | 188 +++++++++
 .../gdb.debuginfod/solib-with-dwz-bar.c       |  36 ++
 .../gdb.debuginfod/solib-with-dwz-bar.h       |  25 ++
 .../gdb.debuginfod/solib-with-dwz-common.h    |  32 ++
 .../gdb.debuginfod/solib-with-dwz-foo.c       |  79 ++++
 .../gdb.debuginfod/solib-with-dwz-foo.h       |  27 ++
 .../gdb.debuginfod/solib-with-dwz-main.c      |  34 ++
 .../gdb.debuginfod/solib-with-dwz.exp         | 378 ++++++++++++++++++
 gdb/testsuite/lib/gdb.exp                     |  34 ++
 23 files changed, 1200 insertions(+), 131 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/dwz-symtabs-bar.c
 create mode 100644 gdb/testsuite/gdb.base/dwz-symtabs-bar.h
 create mode 100644 gdb/testsuite/gdb.base/dwz-symtabs-common.h
 create mode 100644 gdb/testsuite/gdb.base/dwz-symtabs-foo.c
 create mode 100644 gdb/testsuite/gdb.base/dwz-symtabs-foo.h
 create mode 100644 gdb/testsuite/gdb.base/dwz-symtabs-main.c
 create mode 100644 gdb/testsuite/gdb.base/dwz-symtabs.exp
 create mode 100644 gdb/testsuite/gdb.debuginfod/solib-with-dwz-bar.c
 create mode 100644 gdb/testsuite/gdb.debuginfod/solib-with-dwz-bar.h
 create mode 100644 gdb/testsuite/gdb.debuginfod/solib-with-dwz-common.h
 create mode 100644 gdb/testsuite/gdb.debuginfod/solib-with-dwz-foo.c
 create mode 100644 gdb/testsuite/gdb.debuginfod/solib-with-dwz-foo.h
 create mode 100644 gdb/testsuite/gdb.debuginfod/solib-with-dwz-main.c
 create mode 100644 gdb/testsuite/gdb.debuginfod/solib-with-dwz.exp


base-commit: 5d8562e89a612f2d0e5c9e0813a0d37620eff78c