This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix initialization of m_debug_cu_index_map
ClosedPublic

Authored by alexander-shaposhnikov on Oct 2 2017, 10:50 PM.

Details

Summary

SymbolFileDWARFDwp contains m_debug_cu_index_map which was previously
initialized incorrectly: before m_debug_cu_index.parse is called m_debug_cu_index is empty,
thus the map was not actually getting populated properly.
This diff moves this step into a private helper method
and calls it after m_debug_cu_index.parse inside the public static method SymbolFileDWARFDwp::Create
(the constructor remains private).

Test plan:

Build a toy test example
main.cpp
clang -gsplit-dwarf -g -O0 main.cpp -o main.exe
llvm-dwp -e main.exe -o main.exe.dwp
Build LLDB with ENABLE_DEBUG_PRINTF set.
Run: lldb -- ./main.exe
Check that the indexes are now correct (before this change they were empty)
Check that debugging works (setting breakpoints, printing local variables (this was not working before))

Diff Detail

Repository
rL LLVM

Event Timeline

alexander-shaposhnikov edited the summary of this revision. (Show Details)Oct 2 2017, 10:50 PM
tberghammer accepted this revision.Oct 3 2017, 5:12 AM

Looks good, thanks for fixing it.

I am slightly confused why it was working for me when I tested it before submission but I must have messed up something during testing.

This revision is now accepted and ready to land.Oct 3 2017, 5:12 AM
This revision was automatically updated to reflect the committed changes.