[Lldb-commits] [PATCH] D98619: [lldb] Use CompileUnit::ResolveSymbolContext in SymbolFileDWARF

Kim-Anh Tran via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Mar 14 23:19:39 PDT 2021


kimanh created this revision.
kimanh added reviewers: labath, jasonmolenda.
kimanh added a project: LLDB.
Herald added subscribers: JDevlieghere, arphaman.
kimanh requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: lldb-commits, sstefan1.

SymbolFileDWARF::ResolveSymbolContext is currently unaware that in DWARF5 the primary file is specified at file index 0. As a result it misses to correctly resolve the symbol context for the primary file when DWARF5 debug data is used and the primary file is only specified at index 0.

This change makes use of CompileUnit::ResolveSymbolContext to resolve the symbol context. The ResolveSymbolContext in CompileUnit has been previously already updated to reflect changes in DWARF5
and contains a more readable version. It can resolve more, but will also do a bit more work than
SymbolFileDWARF::ResolveSymbolContext (getting the Module, and going through SymbolFileDWARF::ResolveSymbolContextForAddress), however, it's mostly directed by $resolve_scope
what will be resolved, and ensures that code is easier to maintain if there's only one path.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98619

Files:
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Symbol/CompileUnit.cpp
  lldb/test/Shell/SymbolFile/DWARF/dwarf5-debug_line-file-index.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98619.330562.patch
Type: text/x-patch
Size: 11247 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210315/05387a95/attachment-0001.bin>


More information about the lldb-commits mailing list