[all-commits] [llvm/llvm-project] 884357: [lldb/DWARF] Don't get confused by line sequences ...

Pavel Labath via All-commits all-commits at lists.llvm.org
Fri Jul 17 04:23:02 PDT 2020


  Branch: refs/heads/release/11.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 884357e301a9318003a9c229ae73aa06caea0592
      https://github.com/llvm/llvm-project/commit/884357e301a9318003a9c229ae73aa06caea0592
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2020-07-17 (Fri, 17 Jul 2020)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    A lldb/test/Shell/SymbolFile/DWARF/debug_line-tombstone.s

  Log Message:
  -----------
  [lldb/DWARF] Don't get confused by line sequences with tombstone values

Summary:
With D81784, lld has started debug info resolving relocations to
garbage-collected symbols as -1 (instead of relocation addend). For an
unaware consumer this generated sequences which seemingly wrap the
address space -- their first entry was 0xfffff, but all other entries
were low numbers.

Lldb stores line sequences concatenated into one large vector, sorted by
the first entry, and searched with std::lower_bound. This resulted in
the low-value entries being placed at the end of the vector, which
utterly confused the lower_bound algorithm, and caused it to not find a
match. (Previously, these sequences would be at the start of the vector,
and normally would contain addresses that are far smaller than any real
address we want to look up, so std::lower_bound was fine.)

This patch makes lldb ignore these kinds of sequences completely. It
does that by changing the construction algorithm from iterating over the
rows (as parsed by llvm), to iterating over the sequences. This is
important because the llvm parsed performs validity checks when
constructing the sequence array, whereas the row array contains raw
data.

Reviewers: JDevlieghere, MaskRay

Differential Revision: https://reviews.llvm.org/D83957

(cherry picked from commit f3fab392f57421a5bdabfb7e40820257d8f637b2)




More information about the All-commits mailing list