Author: xiaobai Date: Fri Jun 7 17:55:03 2019 New Revision: 362862 URL: http://llvm.org/viewvc/llvm-project?rev=362862&view=rev Log: Revert "DWARF: Simplify SymbolFileDWARF::GetDWARFCompileUnit"
This reverts commit 58afc1bdebf9fa8b178d6c9d89af94c5cc091760. This commit caused the test suite on macOS to fail many tests. It appears that setting breakpoints is the issue. One example that fails is the lit test Breakpoint/case-sensitive.test. Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=362862&r1=362861&r2=362862&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Jun 7 17:55:03 2019 @@ -608,7 +608,15 @@ SymbolFileDWARF::GetDWARFCompileUnit(lld if (!comp_unit) return nullptr; - return static_cast<DWARFUnit *>(comp_unit->GetUserData()); + DWARFDebugInfo *info = DebugInfo(); + if (info) { + // The compile unit ID is the index of the DWARF unit. + DWARFUnit *dwarf_cu = info->GetUnitAtIndex(comp_unit->GetID()); + if (dwarf_cu && dwarf_cu->GetUserData() == nullptr) + dwarf_cu->SetUserData(comp_unit); + return dwarf_cu; + } + return nullptr; } DWARFDebugRangesBase *SymbolFileDWARF::GetDebugRanges() { _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits