[Lldb-commits] [PATCH] D52375: [WIP] Support multiple compile units per OSO entry in SymbolFileDWARFDebugMap

Stefan Gränitz via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 21 13:01:02 PDT 2018


sgraenitz created this revision.
sgraenitz added reviewers: clayborg, aprantl, jingham, jasonmolenda.
Herald added subscribers: dexonsmith, JDevlieghere, mehdi_amini.

So far SymbolFileDWARFDebugMap did only parse one compile unit per OSO entry. Thus, LLDB failed to resolve breakpoint locations in LTO objects with embedded DWARF.

This is a first minimal patch, that primairily fixes my bug. The central issues are:

- SymbolFileDWARFDebugMap::InitOSO() -- For each OSO entry we need to parse all compile units and store their individual offsets.
- SymbolFileDWARF::ParseCompileUnit() -- Parse the compile unit that matches the given dwarf_cu. At this point there is no context information except offset, so use offset mapping from InitOSO(). (The cu_idx parameter is the default from SymbolFileDWARF::GetCompUnitForDWARFCompUnit() in this execution path.)
- DWARFUnit::BuildAddressRangeTable() -- Subsequent TAG_compile_unit's have no AT_ranges. Passing true for check_hi_lo_pc enables fallback to construct the range from AT_low/high_pc. It is not fully clear to me whether the missing tags are expected and the fallback reliable.
- SymbolFileDWARFDebugMap::HasCompileUnits() -- New function with only the subset of InitOSO() required for CalculateAbilities(). Full init should only run once we're sure this is the right plugin.

Missing in the first patch:

- tests that reproduce the issue
- cleanup of dead code I found
- refactorings for involved code and data structures

FIXMEs indicate further changes I consider necessary, but I am quite new to the code base, so please don't hesitate to point out what I failed to see.

A part of this was shortly discussed on the mailing list:
http://lists.llvm.org/pipermail/lldb-dev/2018-September/014160.html


https://reviews.llvm.org/D52375

Files:
  include/lldb/Symbol/Symtab.h
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
  source/Symbol/Symtab.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52375.166535.patch
Type: text/x-patch
Size: 22536 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180921/db1c4dab/attachment-0001.bin>


More information about the lldb-commits mailing list