Changeset View
Changeset View
Standalone View
Standalone View
lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | void ManualDWARFIndex::IndexUnit(DWARFUnit &unit, SymbolFileDWARFDwo *dwp, | ||||
if (log) { | if (log) { | ||||
m_module.LogMessage( | m_module.LogMessage( | ||||
log, "ManualDWARFIndex::IndexUnit for unit at .debug_info[0x%8.8x]", | log, "ManualDWARFIndex::IndexUnit for unit at .debug_info[0x%8.8x]", | ||||
unit.GetOffset()); | unit.GetOffset()); | ||||
} | } | ||||
const LanguageType cu_language = SymbolFileDWARF::GetLanguage(unit); | const LanguageType cu_language = SymbolFileDWARF::GetLanguage(unit); | ||||
IndexUnitImpl(unit, cu_language, set); | // First check if the unit has a DWO ID. If it does then we only want to index | ||||
// the .dwo file or nothing at all. If we have a compile unit where we can't | |||||
// locate the .dwo/.dwp file we don't want to index anything from the skeleton | |||||
// compile unit because it is usally has no children unless | |||||
// -fsplit-dwarf-inlining was used at compile time. This option will add a | |||||
// copy of all DW_TAG_subprogram and any contained DW_TAG_inline_subroutine | |||||
// DIEs so that symbolication will still work in the absence of the .dwo/.dwp | |||||
// file, but the functions have no return types and all arguments and locals | |||||
// have been removed. So we don't want to index any of these hacked up | |||||
// function types. Types can still exist in the skeleton compile unit DWARF | |||||
// though as some functions have template parameter types and other things | |||||
// that cause extra copies of types to be included, but we should find these | |||||
// types in the .dwo file only as methods could have return types removed and | |||||
// we don't have to index incomplete types from the skeletone compile unit. | |||||
if (unit.GetDWOId()) { | |||||
if (SymbolFileDWARFDwo *dwo_symbol_file = unit.GetDwoSymbolFile()) { | if (SymbolFileDWARFDwo *dwo_symbol_file = unit.GetDwoSymbolFile()) { | ||||
// Type units in a dwp file are indexed separately, so we just need to | // Type units in a dwp file are indexed separately, so we just need to | ||||
// process the split unit here. However, if the split unit is in a dwo file, | // process the split unit here. However, if the split unit is in a dwo file, | ||||
// then we need to process type units here. | // then we need to process type units here. | ||||
if (dwo_symbol_file == dwp) { | if (dwo_symbol_file == dwp) { | ||||
IndexUnitImpl(unit.GetNonSkeletonUnit(), cu_language, set); | IndexUnitImpl(unit.GetNonSkeletonUnit(), cu_language, set); | ||||
} else { | } else { | ||||
DWARFDebugInfo &dwo_info = dwo_symbol_file->DebugInfo(); | DWARFDebugInfo &dwo_info = dwo_symbol_file->DebugInfo(); | ||||
for (size_t i = 0; i < dwo_info.GetNumUnits(); ++i) | for (size_t i = 0; i < dwo_info.GetNumUnits(); ++i) | ||||
IndexUnitImpl(*dwo_info.GetUnitAtIndex(i), cu_language, set); | IndexUnitImpl(*dwo_info.GetUnitAtIndex(i), cu_language, set); | ||||
} | } | ||||
} | } | ||||
} else { | |||||
// We either have a normal compile unit which we want to index. | |||||
IndexUnitImpl(unit, cu_language, set); | |||||
} | |||||
} | } | ||||
void ManualDWARFIndex::IndexUnitImpl(DWARFUnit &unit, | void ManualDWARFIndex::IndexUnitImpl(DWARFUnit &unit, | ||||
const LanguageType cu_language, | const LanguageType cu_language, | ||||
IndexSet &set) { | IndexSet &set) { | ||||
for (const DWARFDebugInfoEntry &die : unit.dies()) { | for (const DWARFDebugInfoEntry &die : unit.dies()) { | ||||
const dw_tag_t tag = die.Tag(); | const dw_tag_t tag = die.Tag(); | ||||
▲ Show 20 Lines • Show All 532 Lines • Show Last 20 Lines |