[Lldb-commits] [PATCH] D83957: [lldb/DWARF] Don't get confused by line sequences with tombstone values

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 16 08:41:32 PDT 2020


labath created this revision.
labath added reviewers: JDevlieghere, MaskRay.
Herald added a subscriber: aprantl.
Herald added a project: LLDB.

Recently, lld has started debug info resolving relocations to garbage-collected
symbols as -1 (instead of 0). 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83957

Files:
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/test/Shell/SymbolFile/DWARF/debug_line-tombstone.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83957.278503.patch
Type: text/x-patch
Size: 6720 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200716/85a38bbf/attachment.bin>


More information about the lldb-commits mailing list