[Lldb-commits] [PATCH] D65647: Fix line table resolution near the end of a section

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 2 05:14:08 PDT 2019


labath created this revision.
labath added reviewers: clayborg, jingham.
Herald added a subscriber: mgorny.

lld r367537 changed the way the linker organizes sections and segments.
This exposed an lldb bug and caused some tests to fail.

In all of the failing tests the root cause was the same -- when we were
trying to resolve the last address in the line_table section, we failed
because it pointed past the end of the section.

This is similar to the problem encountered in D32022 <https://reviews.llvm.org/D32022>, where we had a
problem with unwinding of functions near the end of the section/module.
In that patch, we added a flag which allowed these end addresses to
resolve to the section, but we only did so for load address computations
(SectionLoadList). line table uses file addresses, and so we are not
able to take advantage of that here.

This patch adds an equivalent flag to the SectionList class, and changes
the line table resolving code to use it for end-of-sequence entries (as
those are the only ones that can validly point outside of a section).

I also revert the linker flags which were added to the failing tests to
restore previous behavior, and add a unit test to exercise the new API
more directly.


https://reviews.llvm.org/D65647

Files:
  include/lldb/Core/Module.h
  include/lldb/Core/Section.h
  lit/SymbolFile/DWARF/debug-line-basic.s
  lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s
  lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s
  lit/SymbolFile/DWARF/dir-separator-posix.s
  lit/SymbolFile/DWARF/dir-separator-windows.s
  source/Core/Module.cpp
  source/Core/Section.cpp
  source/Symbol/LineTable.cpp
  unittests/Core/CMakeLists.txt
  unittests/Core/Inputs/resolve-file-address.yaml
  unittests/Core/ModuleTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65647.213020.patch
Type: text/x-patch
Size: 11360 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190802/a1637a40/attachment.bin>


More information about the lldb-commits mailing list