11 #include "llvm/ADT/Optional.h"
12 #include "llvm/Support/Casting.h"
13 #include "llvm/Support/Threading.h"
77 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
78 #include "llvm/Support/FileSystem.h"
79 #include "llvm/Support/FormatVariadic.h"
90 #ifdef ENABLE_DEBUG_PRINTF
92 #define DEBUG_PRINTF(fmt, ...) printf(fmt, __VA_ARGS__)
94 #define DEBUG_PRINTF(fmt, ...)
107 #define LLDB_PROPERTIES_symbolfiledwarf
108 #include "SymbolFileDWARFProperties.inc"
111 #define LLDB_PROPERTIES_symbolfiledwarf
112 #include "SymbolFileDWARFPropertiesEnum.inc"
122 m_collection_sp = std::make_shared<OptionValueProperties>(GetSettingName());
123 m_collection_sp->Initialize(g_symbolfiledwarf_properties);
126 bool IgnoreFileIndexes()
const {
127 return m_collection_sp->GetPropertyAtIndexAsBoolean(
128 nullptr, ePropertyIgnoreIndexes,
false);
132 static PluginProperties &GetGlobalPluginProperties() {
133 static PluginProperties g_settings;
139 static const llvm::DWARFDebugLine::LineTable *
141 llvm::DWARFDebugLine &line,
dw_offset_t line_offset,
146 llvm::DWARFContext &ctx = context.
GetAsLLVM();
147 llvm::Expected<const llvm::DWARFDebugLine::LineTable *> line_table =
148 line.getOrParseLineTable(
149 data, line_offset, ctx,
nullptr, [&](
llvm::Error e) {
152 "SymbolFileDWARF::ParseLineTable failed to parse: {0}");
157 "SymbolFileDWARF::ParseLineTable failed to parse: {0}");
164 llvm::DWARFDebugLine::Prologue &prologue,
170 llvm::DWARFContext &ctx = context.
GetAsLLVM();
171 uint64_t offset = line_offset;
177 "SymbolFileDWARF::ParseSupportFiles failed to parse "
178 "line table prologue: {0}");
183 "SymbolFileDWARF::ParseSupportFiles failed to parse line "
184 "table prologue: {0}");
190 static llvm::Optional<std::string>
195 auto absolute = llvm::DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath;
196 if (prologue.getFileNameByIndex(idx, compile_dir, absolute, abs_path, style))
197 return std::move(abs_path);
201 auto relative = llvm::DILineInfoSpecifier::FileLineInfoKind::RawValue;
202 if (!prologue.getFileNameByIndex(idx, compile_dir, relative, rel_path, style))
204 return std::move(rel_path);
209 const llvm::DWARFDebugLine::Prologue &prologue,
211 llvm::StringRef compile_dir = {}) {
212 FileSpecList support_files;
213 size_t first_file = 0;
214 if (prologue.getVersion() <= 4) {
222 const size_t number_of_files = prologue.FileNames.size();
223 for (
size_t idx = first_file; idx <= number_of_files; ++idx) {
225 if (
auto file_path =
GetFileByIndex(prologue, idx, compile_dir, style)) {
226 if (
auto remapped = module->RemapSourceFile(llvm::StringRef(*file_path)))
227 remapped_file = *remapped;
229 remapped_file = std::move(*file_path);
233 support_files.EmplaceBack(remapped_file, style);
236 return support_files;
240 LogChannelDWARF::Initialize();
241 PluginManager::RegisterPlugin(GetPluginNameStatic(),
242 GetPluginDescriptionStatic(), CreateInstance,
248 if (!PluginManager::GetSettingForSymbolFilePlugin(
249 debugger, PluginProperties::GetSettingName())) {
250 const bool is_global_setting =
true;
251 PluginManager::CreateSettingForSymbolFilePlugin(
252 debugger, GetGlobalPluginProperties().GetValueProperties(),
253 ConstString(
"Properties for the dwarf symbol-file plug-in."),
260 PluginManager::UnregisterPlugin(CreateInstance);
261 LogChannelDWARF::Terminate();
265 return "DWARF and DWARF3 debug symbol file reader.";
274 std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
276 return debug_map_symfile->GetTypeList();
277 return SymbolFileCommon::GetTypeList();
285 if (die_offset >= max_die_offset)
288 if (die_offset >= min_die_offset) {
291 bool add_type =
false;
294 case DW_TAG_array_type:
295 add_type = (type_mask & eTypeClassArray) != 0;
297 case DW_TAG_unspecified_type:
298 case DW_TAG_base_type:
299 add_type = (type_mask & eTypeClassBuiltin) != 0;
301 case DW_TAG_class_type:
302 add_type = (type_mask & eTypeClassClass) != 0;
304 case DW_TAG_structure_type:
305 add_type = (type_mask & eTypeClassStruct) != 0;
307 case DW_TAG_union_type:
308 add_type = (type_mask & eTypeClassUnion) != 0;
310 case DW_TAG_enumeration_type:
311 add_type = (type_mask & eTypeClassEnumeration) != 0;
313 case DW_TAG_subroutine_type:
314 case DW_TAG_subprogram:
315 case DW_TAG_inlined_subroutine:
316 add_type = (type_mask & eTypeClassFunction) != 0;
318 case DW_TAG_pointer_type:
319 add_type = (type_mask & eTypeClassPointer) != 0;
321 case DW_TAG_rvalue_reference_type:
322 case DW_TAG_reference_type:
323 add_type = (type_mask & eTypeClassReference) != 0;
326 add_type = (type_mask & eTypeClassTypedef) != 0;
328 case DW_TAG_ptr_to_member_type:
329 add_type = (type_mask & eTypeClassMemberPointer) != 0;
336 const bool assert_not_being_parsed =
true;
337 Type *type = ResolveTypeUID(die, assert_not_being_parsed);
339 type_set.insert(type);
344 GetTypes(child_die, min_die_offset, max_die_offset, type_mask, type_set);
350 TypeClass type_mask,
TypeList &type_list)
353 std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
363 unit = &unit->GetNonSkeletonUnit();
364 GetTypes(unit->DIE(), unit->GetOffset(), unit->GetNextUnitOffset(),
365 type_mask, type_set);
368 get(GetDWARFCompileUnit(comp_unit));
372 for (
size_t cu_idx = 0; cu_idx < num_cus; ++cu_idx)
376 std::set<CompilerType> compiler_type_set;
377 for (
Type *type : type_set) {
378 CompilerType compiler_type = type->GetForwardCompilerType();
379 if (compiler_type_set.find(compiler_type) == compiler_type_set.end()) {
380 compiler_type_set.insert(compiler_type);
381 type_list.
Insert(type->shared_from_this());
395 case DW_TAG_compile_unit:
396 case DW_TAG_partial_unit:
397 case DW_TAG_subprogram:
398 case DW_TAG_inlined_subroutine:
399 case DW_TAG_lexical_block:
411 UserID(0x7fffffff00000000),
414 m_debug_map_module_wp(), m_debug_map_symfile(nullptr),
415 m_context(m_objfile_sp->GetModule()->GetSectionList(), dwo_section_list),
416 m_fetched_external_modules(false),
422 static ConstString g_dwarf_section_name(
"__DWARF");
423 return g_dwarf_section_name;
428 if (debug_map_symfile)
434 llvm::Expected<TypeSystem &>
437 return debug_map_symfile->GetTypeSystemForLanguage(language);
439 auto type_system_or_err =
440 m_objfile_sp->GetModule()->GetTypeSystemForLanguage(language);
441 if (type_system_or_err) {
442 type_system_or_err->SetSymbolFile(
this);
444 return type_system_or_err;
452 if (!GetGlobalPluginProperties().IgnoreFileIndexes()) {
464 Progress progress(llvm::formatv(
"Loading Apple DWARF index for {0}",
466 m_index = AppleDWARFIndex::Create(
467 *
GetObjectFile()->GetModule(), apple_names, apple_namespaces,
478 llvm::formatv(
"Loading DWARF5 index for {0}", module_desc.
GetData()));
479 llvm::Expected<std::unique_ptr<DebugNamesDWARFIndex>> index_or =
484 m_index = std::move(*index_or);
488 "Unable to read .debug_names data: {0}");
493 std::make_unique<ManualDWARFIndex>(*
GetObjectFile()->GetModule(), *
this);
505 for (SectionSP section_sp : section_list) {
506 if (section_sp->GetChildren().GetSize() > 0) {
516 return version >= 2 && version <= 5;
522 const Section *section =
nullptr;
524 if (section_list ==
nullptr)
527 uint64_t debug_abbrev_file_size = 0;
528 uint64_t debug_info_file_size = 0;
529 uint64_t debug_line_file_size = 0;
538 if (section !=
nullptr) {
549 std::set<dw_form_t> invalid_forms;
551 if (!invalid_forms.empty()) {
553 error.Printf(
"unsupported DW_FORM value%s:",
554 invalid_forms.size() > 1 ?
"s" :
"");
555 for (
auto form : invalid_forms)
556 error.Printf(
" %#x", form);
558 "%s",
error.GetString().str().c_str());
569 llvm::StringRef symfile_dir =
570 m_objfile_sp->GetFileSpec().GetDirectory().GetStringRef();
571 if (symfile_dir.contains_insensitive(
".dsym")) {
572 if (
m_objfile_sp->GetType() == ObjectFile::eTypeDebugInfo) {
582 "empty dSYM file detected, dSYM was created with an "
583 "executable with no debug info.");
589 if (debug_abbrev_file_size > 0 && debug_info_file_size > 0)
593 if (debug_line_file_size > 0)
602 const SectionList *section_list = module_sp->GetSectionList();
622 auto abbr = std::make_unique<DWARFDebugAbbrev>();
627 "Unable to read .debug_abbrev section: {0}");
638 static_cast<void *
>(
this));
650 if (dwarf_cu && dwarf_cu->
GetUserData() ==
nullptr)
654 return llvm::cast_or_null<DWARFCompileUnit>(dwarf_cu);
660 static_cast<void *
>(
this));
663 m_ranges = std::make_unique<DWARFDebugRanges>();
674 const ModuleSP &module_sp) {
682 if (
auto remapped_file = module_sp->RemapSourceFile(file_spec.
GetPath()))
683 file_spec.
SetFile(*remapped_file, FileSpec::Style::native);
689 const char *dwo_name =
702 cu_sp = comp_unit->shared_from_this();
711 auto initialize_cu = [&](
const FileSpec &file_spec,
714 cu_sp = std::make_shared<CompileUnit>(
715 module_sp, &dwarf_cu, file_spec,
724 auto lazy_initialize_cu = [&]() {
743 FileSpecList support_files;
746 if (support_files.GetSize() == 0)
749 initialize_cu(support_files.GetFileSpecAtIndex(0),
751 cu_sp->SetSupportFiles(std::move(support_files));
755 if (!lazy_initialize_cu()) {
769 initialize_cu(cu_file_spec, cu_language);
788 if (
auto *cu = llvm::dyn_cast<DWARFCompileUnit>(info.
GetUnitAtIndex(i))) {
813 if (
auto *dwarf_cu = llvm::cast_or_null<DWARFCompileUnit>(
827 if (
auto err = type_system_or_err.takeError()) {
829 "Unable to parse function");
837 if (die.
GetDIE()->GetAttributeAddressRanges(die.
GetCU(), ranges,
846 lowest_func_addr >= highest_func_addr ||
853 lowest_func_addr, module_sp->GetSectionList());
857 func_range.
SetByteSize(highest_func_addr - lowest_func_addr);
866 if (debug_map_symfile)
873 if (debug_map_symfile) {
899 const char *sysroot =
905 ModuleSP module_sp = comp_unit.
GetModule();
907 module_sp->RegisterXcodeSDK(sdk, sysroot);
910 if (local_module_sp && local_module_sp != module_sp)
911 local_module_sp->RegisterXcodeSDK(sdk, sysroot);
923 size_t functions_added = 0;
926 if (entry.Tag() != DW_TAG_subprogram)
936 return functions_added;
941 llvm::DenseSet<lldb_private::SymbolFile *> &visited_symbol_files,
942 llvm::function_ref<
bool(
Module &)> lambda) {
944 if (!visited_symbol_files.insert(
this).second)
949 ModuleSP module = p.second;
957 for (std::size_t i = 0; i < module->GetNumCompileUnits(); ++i) {
958 auto cu = module->GetCompileUnitAtIndex(i);
959 bool early_exit = cu->ForEachExternalModule(visited_symbol_files, lambda);
968 FileSpecList &support_files) {
982 const ModuleSP &module,
983 FileSpecList &support_files) {
990 llvm::DWARFDebugLine::Prologue prologue;
1003 if (
auto *dwarf_cu = llvm::dyn_cast<DWARFCompileUnit>(&unit)) {
1005 return lldb_cu->GetSupportFiles().GetFileSpecAtIndex(file_idx);
1009 auto &tu = llvm::cast<DWARFTypeUnit>(unit);
1013 const FileSpecList &
1015 static FileSpecList empty_list;
1019 offset == llvm::DenseMapInfo<dw_offset_t>::getEmptyKey() ||
1020 offset == llvm::DenseMapInfo<dw_offset_t>::getTombstoneKey())
1026 FileSpecList &
list = iter_bool.first->second;
1027 if (iter_bool.second) {
1028 uint64_t line_table_offset = offset;
1031 llvm::DWARFDebugLine::Prologue prologue;
1035 "SymbolFileDWARF::GetTypeUnitSupportFiles failed to parse "
1036 "the line table prologue");
1041 report(std::move(
error));
1060 std::vector<SourceModule> &imported_modules) {
1066 if (!ClangModulesDeclVendor::LanguageSupportsClangModules(
1076 if (child_die.Tag() != DW_TAG_imported_declaration)
1080 if (module_die.
Tag() != DW_TAG_module)
1083 if (
const char *name =
1089 while ((parent_die = parent_die.
GetParent())) {
1090 if (parent_die.
Tag() != DW_TAG_module)
1092 if (
const char *name =
1096 std::reverse(module.
path.begin(), module.
path.end());
1098 DW_AT_LLVM_include_path,
nullptr)) {
1105 DW_AT_LLVM_sysroot,
nullptr))
1107 imported_modules.push_back(module);
1127 llvm::DWARFDebugLine line;
1128 const llvm::DWARFDebugLine::LineTable *line_table =
1137 std::vector<std::unique_ptr<LineSequence>> sequences;
1140 for (
const llvm::DWARFDebugLine::Sequence &seq : line_table->Sequences) {
1147 std::unique_ptr<LineSequence> sequence =
1148 LineTable::CreateLineSequenceContainer();
1149 for (
unsigned idx = seq.FirstRowIndex; idx < seq.LastRowIndex; ++idx) {
1150 const llvm::DWARFDebugLine::Row &row = line_table->Rows[idx];
1151 LineTable::AppendLineEntryToSequence(
1152 sequence.get(), row.Address.Address, row.Line, row.Column, row.File,
1153 row.IsStmt, row.BasicBlock, row.PrologueEnd, row.EpilogueBegin,
1156 sequences.push_back(std::move(sequence));
1159 std::unique_ptr<LineTable> line_table_up =
1160 std::make_unique<LineTable>(&comp_unit, std::move(sequences));
1167 debug_map_symfile->LinkOSOLineTable(
this, line_table_up.get()));
1179 return iter->second;
1193 offset,
this, debug_macros_sp);
1195 return debug_macros_sp;
1202 if (dwarf_cu ==
nullptr)
1225 size_t blocks_added = 0;
1231 case DW_TAG_inlined_subroutine:
1232 case DW_TAG_subprogram:
1233 case DW_TAG_lexical_block: {
1234 Block *block =
nullptr;
1235 if (tag == DW_TAG_subprogram) {
1243 block = parent_block;
1247 block = block_sp.get();
1250 const char *name =
nullptr;
1251 const char *mangled_name =
nullptr;
1255 int decl_column = 0;
1258 int call_column = 0;
1260 decl_line, decl_column, call_file, call_line,
1261 call_column,
nullptr)) {
1262 if (tag == DW_TAG_subprogram) {
1265 }
else if (tag == DW_TAG_inlined_subroutine) {
1279 const size_t num_ranges = ranges.
GetSize();
1280 for (
size_t i = 0; i < num_ranges; ++i) {
1283 if (range_base >= subprogram_low_pc)
1288 "0x%8.8" PRIx64
": adding range [0x%" PRIx64
"-0x%" PRIx64
1289 ") which has a base that is less than the function's low PC "
1290 "0x%" PRIx64
". Please file a bug and attach the file at the "
1291 "start of this error message",
1298 if (tag != DW_TAG_subprogram &&
1299 (name !=
nullptr || mangled_name !=
nullptr)) {
1300 std::unique_ptr<Declaration> decl_up;
1301 if (decl_file != 0 || decl_line != 0 || decl_column != 0)
1302 decl_up = std::make_unique<Declaration>(
1304 decl_line, decl_column);
1306 std::unique_ptr<Declaration> call_up;
1307 if (call_file != 0 || call_line != 0 || call_column != 0)
1308 call_up = std::make_unique<Declaration>(
1310 call_line, call_column);
1321 subprogram_low_pc, depth + 1);
1338 return blocks_added;
1345 bool check_virtuality =
false;
1347 case DW_TAG_inheritance:
1348 case DW_TAG_subprogram:
1349 check_virtuality =
true;
1354 if (check_virtuality) {
1355 if (die.GetAttributeValueAsUnsigned(DW_AT_virtuality, 0) != 0)
1365 if (type_system !=
nullptr)
1380 llvm::Optional<SymbolFileDWARF::DecodedUID>
1394 debug_map->GetOSOIndexFromUserID(uid));
1403 uid >> 63 ? DIERef::Section::DebugTypes : DIERef::Section::DebugInfo;
1405 llvm::Optional<uint32_t> dwo_num;
1406 bool dwo_valid = uid >> 62 & 1;
1408 dwo_num = uid >> 32 & 0x3fffffff;
1410 return DecodedUID{*
this, {dwo_num, section, die_offset}};
1419 llvm::Optional<DecodedUID> decoded =
DecodeUID(uid);
1422 return decoded->dwarf.GetDIE(decoded->ref);
1469 return type_die.ResolveType();
1474 llvm::Optional<SymbolFile::ArrayInfo>
1489 bool assert_not_being_parsed) {
1494 log,
"SymbolFileDWARF::ResolveTypeUID (die = 0x%8.8x) %s '%s'",
1503 switch (decl_ctx_die.
Tag()) {
1504 case DW_TAG_structure_type:
1505 case DW_TAG_union_type:
1506 case DW_TAG_class_type: {
1511 "SymbolFileDWARF::ResolveTypeUID (die = 0x%8.8x) %s '%s' "
1512 "resolve parent forward type for 0x%8.8x",
1533 ClangUtil::RemoveFastQualifiers(compiler_type);
1541 llvm::dyn_cast_or_null<TypeSystemClang>(type_system);
1542 if (!clang_type_system)
1553 llvm::dyn_cast_or_null<TypeSystemClang>(compiler_type.
GetTypeSystem());
1554 if (clang_type_system) {
1564 ClangUtil::RemoveFastQualifiers(compiler_type);
1582 Log *log =
GetLog(DWARFLog::DebugInfo | DWARFLog::TypeCompletion);
1585 log,
"0x%8.8" PRIx64
": %s '%s' resolving forward declaration...",
1588 assert(compiler_type);
1590 return dwarf_ast->CompleteTypeFromDWARF(dwarf_die, type, compiler_type);
1596 bool assert_not_being_parsed,
1597 bool resolve_function_context) {
1601 if (assert_not_being_parsed) {
1606 "Parsing a die that is being parsed die: 0x%8.8x: %s %s",
1635 m_index->GetObjCMethods(class_name, callback);
1641 if (die && llvm::isa<DWARFCompileUnit>(die.
GetCU())) {
1665 return lldb::ModuleSP();
1676 return dwarf->DebugInfo().GetDIE(die_ref);
1698 if (uint64_t dwo_id = ::
GetDWOId(*cu, *cu_die))
1704 std::shared_ptr<SymbolFileDWARFDwo>
1720 const char *dwo_name =
GetDWOName(*dwarf_cu, cu_die);
1728 FileSystem::Instance().Resolve(dwo_file);
1730 const char *comp_dir =
1735 dwo_file.
SetFile(comp_dir, FileSpec::Style::native);
1741 m_objfile_sp->GetFileSpec().GetDirectory().GetStringRef());
1743 FileSystem::Instance().Resolve(dwo_file);
1747 if (!FileSystem::Instance().Exists(dwo_file)) {
1750 "unable to locate separate debug file (dwo, dwp). Debugging will be "
1757 DataBufferSP dwo_file_data_sp;
1759 ObjectFileSP dwo_obj_file = ObjectFile::FindPlugin(
1761 FileSystem::Instance().GetByteSize(dwo_file), dwo_file_data_sp,
1762 dwo_file_data_offset);
1763 if (dwo_obj_file ==
nullptr)
1766 return std::make_shared<SymbolFileDWARFDwo>(*
this, dwo_obj_file,
1778 for (
uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
1780 llvm::dyn_cast<DWARFCompileUnit>(debug_info.
GetUnitAtIndex(cu_idx));
1804 const char *comp_dir =
1808 FileSpec::Style::native);
1809 FileSystem::Instance().Resolve(dwo_module_spec.
GetFileSpec());
1828 if (
m_objfile_sp->GetFileSpec().GetFileNameExtension() ==
".dwo" &&
1834 Status error = ModuleList::GetSharedModule(dwo_module_spec, module_sp,
1835 nullptr,
nullptr,
nullptr);
1838 "0x%8.8x: unable to locate module needed for external types: "
1839 "%s\nerror: %s\nDebugging will be degraded due to missing "
1840 "types. Rebuilding the project will regenerate the needed "
1843 error.AsCString(
"unknown error"));
1854 llvm::dyn_cast_or_null<SymbolFileDWARF>(module_sp->GetSymbolFile());
1857 llvm::Optional<uint64_t> dwo_dwo_id = dwo_symfile->GetDWOId();
1861 if (dwo_id != dwo_dwo_id) {
1863 "0x%8.8x: Module %s is out-of-date (hash mismatch). Type information "
1864 "from this module may be incomplete or inconsistent with the rest of "
1865 "the program. Rebuilding the project will regenerate the needed "
1878 const size_t num_cus = module_sp->GetNumCompileUnits();
1879 for (
size_t i = 0; i < num_cus; ++i) {
1880 CompUnitSP cu_sp = module_sp->GetCompileUnitAtIndex(i);
1882 VariableListSP globals_sp = cu_sp->GetVariableList(
true);
1884 const size_t num_globals = globals_sp->GetSize();
1885 for (
size_t g = 0; g < num_globals; ++g) {
1886 VariableSP var_sp = globals_sp->GetVariableAtIndex(g);
1887 if (var_sp && !var_sp->GetLocationIsConstantValueData()) {
1889 Value location_result;
1892 nullptr, location_result, &
error)) {
1894 Value::ValueType::FileAddress) {
1898 if (var_sp->GetType())
1900 var_sp->GetType()->GetByteSize(
nullptr).value_or(0);
1902 file_addr, byte_size, var_sp.get()));
1944 SymbolContextItem resolve_scope,
1948 "ResolveSymbolContext (so_addr = { "
1949 "section = %p, offset = 0x%" PRIx64
1950 " }, resolve_scope = 0x%8.8x)",
1951 static_cast<void *
>(so_addr.
GetSection().get()),
1955 (eSymbolContextCompUnit | eSymbolContextFunction | eSymbolContextBlock |
1956 eSymbolContextLineEntry | eSymbolContextVariable)) {
1968 if (resolve_scope & eSymbolContextVariable) {
1971 map.FindEntryThatContains(file_vm_addr);
1972 if (entry && entry->data) {
1984 if (
auto *dwarf_cu = llvm::dyn_cast_or_null<DWARFCompileUnit>(
1989 resolved |= eSymbolContextCompUnit;
1991 bool force_check_line_table =
false;
1992 if (resolve_scope & (eSymbolContextFunction | eSymbolContextBlock)) {
1994 resolve_scope & eSymbolContextBlock, sc);
1996 resolved |= eSymbolContextFunction;
2004 force_check_line_table =
true;
2007 resolved |= eSymbolContextBlock;
2010 if ((resolve_scope & eSymbolContextLineEntry) ||
2011 force_check_line_table) {
2013 if (line_table !=
nullptr) {
2023 resolved |= eSymbolContextLineEntry;
2029 if (force_check_line_table && !(resolved & eSymbolContextLineEntry)) {
2036 resolved &= ~eSymbolContextCompUnit;
2040 "0x%8.8x: compile unit %u failed to create a valid "
2041 "lldb_private::CompileUnit class.",
2056 if (resolve_scope & eSymbolContextCompUnit) {
2063 bool file_spec_matches_cu_file_spec = FileSpec::Match(
2065 if (check_inlines || file_spec_matches_cu_file_spec) {
2072 return sc_list.
GetSize() - prev_size;
2090 return module_sp->GetMutex();
2106 if (
auto err = type_system_or_err.takeError()) {
2108 "Unable to match namespace decl using TypeSystem");
2112 if (decl_ctx_type_system == &type_system_or_err.get())
2120 log,
"Valid namespace does not match symbol file");
2134 "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", "
2135 "parent_decl_ctx=%p, max_matches=%u, variables)",
2136 name.
GetCString(),
static_cast<const void *
>(&parent_decl_ctx),
2145 llvm::StringRef basename;
2146 llvm::StringRef context;
2147 bool name_is_mangled = Mangled::GetManglingScheme(name.
GetStringRef()) !=
2148 Mangled::eManglingSchemeNone;
2150 if (!CPlusPlusLanguage::ExtractContextAndIdentifier(name.
GetCString(),
2156 uint32_t pruned_idx = original_size;
2164 if (die.
Tag() != DW_TAG_variable)
2167 auto *dwarf_cu = llvm::dyn_cast<DWARFCompileUnit>(die.
GetCU());
2172 if (parent_decl_ctx) {
2175 dwarf_ast->GetDeclContextContainingUIDFromDWARF(die);
2176 if (!actual_parent_decl_ctx ||
2177 actual_parent_decl_ctx != parent_decl_ctx)
2183 while (pruned_idx < variables.
GetSize()) {
2185 if (name_is_mangled ||
2186 var_sp->GetName().GetStringRef().contains(name.
GetStringRef()))
2192 return variables.
GetSize() - original_size < max_matches;
2197 if (log && num_matches > 0) {
2200 "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", "
2201 "parent_decl_ctx=%p, max_matches=%u, variables) => %u",
2202 name.
GetCString(),
static_cast<const void *
>(&parent_decl_ctx),
2203 max_matches, num_matches);
2216 "SymbolFileDWARF::FindGlobalVariables (regex=\"%s\", "
2217 "max_matches=%u, variables)",
2218 regex.
GetText().str().c_str(), max_matches);
2237 return variables.
GetSize() - original_size < max_matches;
2242 bool include_inlines,
2250 if (!(orig_die.
Tag() == DW_TAG_subprogram ||
2251 (include_inlines && orig_die.
Tag() == DW_TAG_inlined_subroutine)))
2256 if (die.
Tag() == DW_TAG_inlined_subroutine) {
2263 if (die.
Tag() == DW_TAG_subprogram)
2269 assert(die && die.
Tag() == DW_TAG_subprogram);
2276 if (sc.
block ==
nullptr)
2303 dwarf_ast->GetDeclContextContainingUIDFromDWARF(die))
2312 FunctionNameType name_type_mask,
2313 bool include_inlines,
2321 assert((name_type_mask & eFunctionNameTypeAuto) == 0);
2328 "SymbolFileDWARF::FindFunctions (name=\"%s\", name_type_mask=0x%x, "
2345 llvm::DenseSet<const DWARFDebugInfoEntry *> resolved_dies;
2347 m_index->GetFunctions(name, *
this, parent_decl_ctx, name_type_mask,
2349 if (resolved_dies.insert(die.
GetDIE()).second)
2357 if (log && num_matches > 0) {
2360 "SymbolFileDWARF::FindFunctions (name=\"%s\", "
2361 "name_type_mask=0x%x, include_inlines=%d, sc_list) => %u",
2362 name.
GetCString(), name_type_mask, include_inlines, num_matches);
2367 bool include_inlines,
2371 regex.
GetText().str().c_str());
2377 log,
"SymbolFileDWARF::FindFunctions (regex=\"%s\", sc_list)",
2378 regex.
GetText().str().c_str());
2381 llvm::DenseSet<const DWARFDebugInfoEntry *> resolved_dies;
2383 if (resolved_dies.insert(die.
GetDIE()).second)
2391 std::vector<ConstString> &mangled_names) {
2394 for (
uint32_t i = 0; i < num_comp_units; i++) {
2414 llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
2418 if (!searched_symbol_files.insert(
this).second)
2424 if (parent_decl_ctx)
2427 "SymbolFileDWARF::FindTypes (sc, name=\"%s\", parent_decl_ctx = "
2428 "%p (\"%s\"), max_matches=%u, type_list)",
2429 name.
GetCString(),
static_cast<const void *
>(&parent_decl_ctx),
2434 "SymbolFileDWARF::FindTypes (sc, name=\"%s\", parent_decl_ctx = "
2435 "NULL, max_matches=%u, type_list)",
2453 return types.
GetSize() < max_matches;
2459 if (types.
GetSize() < max_matches) {
2463 if (ModuleSP external_module_sp = pair.second)
2464 if (
SymbolFile *sym_file = external_module_sp->GetSymbolFile())
2465 sym_file->FindTypes(name, parent_decl_ctx, max_matches,
2466 searched_symbol_files, types);
2470 if (parent_decl_ctx) {
2473 "SymbolFileDWARF::FindTypes (sc, name=\"%s\", parent_decl_ctx "
2474 "= %p (\"%s\"), max_matches=%u, type_list) => %u",
2475 name.
GetCString(),
static_cast<const void *
>(&parent_decl_ctx),
2481 "SymbolFileDWARF::FindTypes (sc, name=\"%s\", parent_decl_ctx "
2482 "= NULL, max_matches=%u, type_list) => %u",
2489 llvm::ArrayRef<CompilerContext> pattern,
LanguageSet languages,
2490 llvm::DenseSet<SymbolFile *> &searched_symbol_files,
TypeMap &types) {
2492 if (!searched_symbol_files.insert(
this).second)
2496 if (pattern.empty())
2508 llvm::SmallVector<CompilerContext, 4> die_context;
2527 if (ModuleSP external_module_sp = pair.second)
2528 external_module_sp->FindTypes(pattern, languages, searched_symbol_files,
2540 log,
"SymbolFileDWARF::FindNamespace (sc, name=\"%s\")",
2547 return namespace_decl_ctx;
2558 return !namespace_decl_ctx.
IsValid();
2561 if (log && namespace_decl_ctx) {
2564 "SymbolFileDWARF::FindNamespace (sc, name=\"%s\") => "
2565 "CompilerDeclContext(%p/%p) \"%s\"",
2567 static_cast<const void *
>(namespace_decl_ctx.
GetTypeSystem()),
2572 return namespace_decl_ctx;
2576 bool resolve_function_context) {
2580 if (type_ptr ==
nullptr) {
2582 if (
auto *dwarf_cu = llvm::dyn_cast<DWARFCompileUnit>(die.
GetCU()))
2589 while (parent_die !=
nullptr) {
2590 if (parent_die->
Tag() == DW_TAG_subprogram)
2595 if (resolve_function_context && parent_die !=
nullptr &&
2602 type_sp = type_ptr->shared_from_this();
2617 if (orig_die != die) {
2618 switch (die.
Tag()) {
2619 case DW_TAG_compile_unit:
2620 case DW_TAG_partial_unit:
2621 case DW_TAG_namespace:
2622 case DW_TAG_structure_type:
2623 case DW_TAG_union_type:
2624 case DW_TAG_class_type:
2625 case DW_TAG_lexical_block:
2626 case DW_TAG_subprogram:
2628 case DW_TAG_inlined_subroutine: {
2644 return decl_ctx_die;
2651 return decl_ctx_die;
2661 Symbol *objc_class_symbol =
nullptr;
2667 Symtab::eVisibilityAny);
2670 return objc_class_symbol;
2688 for (
uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
2690 if (dwarf_cu != cu &&
2714 m_index->GetCompleteObjCClass(
2715 type_name, must_be_implementation, [&](
DWARFDIE type_die) {
2716 bool try_resolving_type =
false;
2720 if (type_die != die) {
2721 switch (type_die.
Tag()) {
2722 case DW_TAG_class_type:
2723 case DW_TAG_structure_type:
2724 try_resolving_type = true;
2730 if (!try_resolving_type)
2733 if (must_be_implementation &&
2736 DW_AT_APPLE_objc_complete_type, 0);
2737 if (!try_resolving_type)
2745 "resolved 0x%8.8" PRIx64
" from %s to 0x%8.8" PRIx64
2746 " (cu 0x%8.8" PRIx64
")\n",
2748 m_objfile_sp->GetFileSpec().GetFilename().AsCString(
"<Unknown>"),
2749 type_die.
GetID(), type_cu->GetID());
2753 type_sp = resolved_type->shared_from_this();
2773 std::vector<DWARFDIE> decl_ctx_1;
2774 std::vector<DWARFDIE> decl_ctx_2;
2793 const size_t count1 = decl_ctx_1.size();
2794 const size_t count2 = decl_ctx_2.size();
2795 if (count1 != count2)
2803 for (i = 0; i < count1; i++) {
2804 decl_ctx_die1 = decl_ctx_1[i];
2805 decl_ctx_die2 = decl_ctx_2[i];
2806 if (decl_ctx_die1.
Tag() != decl_ctx_die2.
Tag())
2817 assert(cu_tag == DW_TAG_compile_unit || cu_tag == DW_TAG_partial_unit);
2822 for (i = 0; i < count1 - 1; i++) {
2823 decl_ctx_die1 = decl_ctx_1[i];
2824 decl_ctx_die2 = decl_ctx_2[i];
2825 const char *name1 = decl_ctx_die1.
GetName();
2826 const char *name2 = decl_ctx_die2.
GetName();
2834 if (name1 && name2) {
2836 if (strcmp(name1, name2) != 0)
2853 if (dwarf_decl_ctx_count > 0) {
2854 const ConstString type_name(dwarf_decl_ctx[0].name);
2855 const dw_tag_t tag = dwarf_decl_ctx[0].tag;
2858 Log *log =
GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
2862 "SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(tag=%"
2863 "s, qualified-name='%s')",
2875 if (
auto err = type_system_or_err.takeError()) {
2877 "Cannot get TypeSystem for language {}",
2878 Language::GetNameForLanguageType(language));
2880 type_system = &type_system_or_err.get();
2891 bool try_resolving_type =
false;
2897 if (type_tag == tag) {
2899 try_resolving_type =
true;
2905 case DW_TAG_class_type:
2908 try_resolving_type = (tag == DW_TAG_structure_type);
2910 case DW_TAG_structure_type:
2913 try_resolving_type = (tag == DW_TAG_class_type);
2922 if (!try_resolving_type) {
2929 "FindDefinitionTypeForDWARFDeclContext(tag=%s, "
2930 "qualified-name='%s') ignoring die=0x%8.8x (%s)",
2933 qualified_name.c_str());
2944 "FindDefinitionTypeForDWARFDeclContext(tag=%s, "
2945 "qualified-name='%s') trying die=0x%8.8x (%s)",
2952 if (dwarf_decl_ctx != type_dwarf_decl_ctx)
2959 type_sp = resolved_type->shared_from_this();
2968 bool *type_is_new_ptr) {
2973 if (
auto err = type_system_or_err.takeError()) {
2975 "Unable to parse type");
2979 DWARFASTParser *dwarf_ast = type_system_or_err->GetDWARFParser();
2987 if (die.
Tag() == DW_TAG_subprogram) {
2991 if (scope_qualified_name.size()) {
3003 bool parse_siblings,
bool parse_children) {
3004 size_t types_added = 0;
3009 bool type_is_new =
false;
3011 Tag dwarf_tag =
static_cast<Tag
>(tag);
3016 if (isType(dwarf_tag) && tag != DW_TAG_subrange_type)
3023 if (die.
Tag() == DW_TAG_subprogram) {
3048 size_t functions_added = 0;
3057 return functions_added;
3062 size_t types_added = 0;
3084 if (function_die.
GetDIE()->GetAttributeAddressRanges(
3085 function_die.
GetCU(), ranges,
3089 const size_t num_variables =
3094 return num_variables;
3099 if (dwarf_cu ==
nullptr)
3105 if (variables.get() ==
nullptr) {
3106 variables = std::make_shared<VariableList>();
3112 variables->AddVariableIfUnique(var_sp);
3131 VariableSP var_sp = die_to_variable[die.
GetDIE()];
3137 die_to_variable[die.
GetDIE()] = var_sp;
3139 die_to_variable[spec_die.GetDIE()] = var_sp;
3156 if (tag != DW_TAG_variable && tag != DW_TAG_constant &&
3157 (tag != DW_TAG_formal_parameter || !sc.
function))
3161 const size_t num_attributes = die.
GetAttributes(attributes);
3162 const char *name =
nullptr;
3163 const char *mangled =
nullptr;
3167 bool is_external =
false;
3168 bool is_artificial =
false;
3172 for (
size_t i = 0; i < num_attributes; ++i) {
3179 case DW_AT_decl_file:
3183 case DW_AT_decl_line:
3186 case DW_AT_decl_column:
3192 case DW_AT_linkage_name:
3193 case DW_AT_MIPS_linkage_name:
3197 type_die_form = form_value;
3199 case DW_AT_external:
3200 is_external = form_value.
Boolean();
3202 case DW_AT_const_value:
3203 const_value_form = form_value;
3205 case DW_AT_location:
3206 location_form = form_value;
3208 case DW_AT_start_scope:
3211 case DW_AT_artificial:
3212 is_artificial = form_value.
Boolean();
3214 case DW_AT_declaration:
3215 case DW_AT_description:
3216 case DW_AT_endianity:
3218 case DW_AT_specification:
3219 case DW_AT_visibility:
3221 case DW_AT_abstract_origin:
3231 bool location_is_const_value_data =
false;
3232 bool has_explicit_location =
false;
3233 bool use_type_size_for_value =
false;
3234 if (location_form.
IsValid()) {
3235 has_explicit_location =
true;
3246 if (location_form.
Form() == DW_FORM_loclistx)
3256 }
else if (const_value_form.
IsValid()) {
3257 location_is_const_value_data =
true;
3267 module,
DataExtractor(debug_info_data, block_offset, block_length),
3273 use_type_size_for_value =
true;
3274 }
else if (
const char *str = const_value_form.
AsCString()) {
3275 uint32_t string_length = strlen(str) + 1;
3287 bool is_static_member = (parent_tag == DW_TAG_compile_unit ||
3288 parent_tag == DW_TAG_partial_unit) &&
3289 (parent_context_die.
Tag() == DW_TAG_class_type ||
3290 parent_context_die.
Tag() == DW_TAG_structure_type);
3295 bool has_explicit_mangled = mangled !=
nullptr;
3307 if ((parent_tag == DW_TAG_compile_unit ||
3308 parent_tag == DW_TAG_partial_unit) &&
3314 if (tag == DW_TAG_formal_parameter)
3325 bool is_static_lifetime =
3326 has_explicit_mangled || (has_explicit_location && !location.
IsValid());
3329 if (!location_is_const_value_data) {
3330 bool op_error =
false;
3337 "0x%8.8x: %s has an invalid location: %s", die.
GetOffset(),
3341 is_static_lifetime =
true;
3344 if (debug_map_symfile)
3350 if (is_static_lifetime) {
3356 if (debug_map_symfile) {
3372 bool linked_oso_file_addr =
false;
3373 if (is_external && location_DW_OP_addr == 0) {
3377 if (debug_map_objfile) {
3379 if (debug_map_symtab) {
3383 Symtab::eVisibilityExtern);
3386 const addr_t exe_file_addr =
3390 linked_oso_file_addr =
true;
3391 symbol_context_scope = exe_symbol;
3400 if (!linked_oso_file_addr) {
3415 if (location_is_const_value_data &&
3416 die.
GetDIE()->IsGlobalOrStaticScopeVariable())
3420 if (debug_map_symfile) {
3425 [
this, debug_map_symfile](
3427 return debug_map_symfile->LinkOSOFileAddress(
3428 this, unlinked_file_addr);
3437 if (symbol_context_scope ==
nullptr) {
3438 switch (parent_tag) {
3439 case DW_TAG_subprogram:
3440 case DW_TAG_inlined_subroutine:
3441 case DW_TAG_lexical_block:
3443 symbol_context_scope =
3445 if (symbol_context_scope ==
nullptr)
3446 symbol_context_scope = sc.
function;
3456 if (!symbol_context_scope) {
3463 auto type_sp = std::make_shared<SymbolFileType>(
3466 if (use_type_size_for_value && type_sp->GetType())
3468 type_sp->GetType()->GetByteSize(
nullptr).value_or(0),
3471 return std::make_shared<Variable>(
3472 die.
GetID(), name, mangled, type_sp, scope, symbol_context_scope,
3473 scope_ranges, &decl, location, is_external, is_artificial,
3474 location_is_const_value_data, is_static_member);
3484 spec_block_die_offset);
3491 switch (die.
Tag()) {
3492 case DW_TAG_subprogram:
3493 case DW_TAG_inlined_subroutine:
3494 case DW_TAG_lexical_block: {
3496 spec_block_die_offset)
3500 spec_block_die_offset)
3528 if (tag != DW_TAG_variable && tag != DW_TAG_constant)
3541 VariableListSP variable_list_sp;
3544 switch (parent_tag) {
3545 case DW_TAG_compile_unit:
3546 case DW_TAG_partial_unit:
3551 "parent 0x%8.8" PRIx64
" %s with no valid compile unit in "
3552 "symbol context for 0x%8.8" PRIx64
" %s.\n",
3561 "didn't find appropriate parent DIE for variable list for "
3562 "0x%8.8" PRIx64
" %s.\n",
3572 if (variable_list_sp)
3573 variable_list_sp->AddVariableIfUnique(var_sp);
3589 if (block_die.
Tag() != DW_TAG_inlined_subroutine) {
3590 return std::move(variable_dies);
3595 if (!abs_die || abs_die.
Tag() != DW_TAG_subprogram ||
3597 return std::move(variable_dies);
3602 DIEArray::iterator concrete_it = variable_dies.begin();
3605 bool did_merge_abstract =
false;
3606 for (; abstract_child; abstract_child = abstract_child.
GetSibling()) {
3607 if (abstract_child.
Tag() == DW_TAG_formal_parameter) {
3608 if (concrete_it == variable_dies.end() ||
3609 GetDIE(*concrete_it).
Tag() != DW_TAG_formal_parameter) {
3613 merged.push_back(*abstract_child.
GetDIERef());
3614 did_merge_abstract =
true;
3620 if (origin_of_concrete == abstract_child) {
3623 merged.push_back(*concrete_it);
3628 merged.push_back(*abstract_child.
GetDIERef());
3629 did_merge_abstract =
true;
3635 if (!did_merge_abstract)
3636 return std::move(variable_dies);
3643 for (; concrete_it != variable_dies.end(); ++concrete_it) {
3644 if (
GetDIE(*concrete_it).
Tag() == DW_TAG_formal_parameter) {
3645 return std::move(variable_dies);
3647 merged.push_back(*concrete_it);
3663 dummy_block_variables);
3673 size_t vars_added = 0;
3676 if ((tag == DW_TAG_variable) || (tag == DW_TAG_constant) ||
3677 (tag == DW_TAG_formal_parameter)) {
3678 accumulator.push_back(*die.
GetDIERef());
3682 case DW_TAG_subprogram:
3683 case DW_TAG_inlined_subroutine:
3684 case DW_TAG_lexical_block: {
3688 if (block ==
nullptr) {
3695 if (concrete_block_die)
3700 if (block ==
nullptr)
3703 const bool can_create =
false;
3704 VariableListSP block_variable_list_sp =
3706 if (block_variable_list_sp.get() ==
nullptr) {
3707 block_variable_list_sp = std::make_shared<VariableList>();
3715 sc, child, func_low_pc, block_variables);
3720 block_variables, func_low_pc);
3729 sc, child, func_low_pc, accumulator);
3739 llvm::ArrayRef<DIERef> variable_dies,
lldb::addr_t func_low_pc) {
3741 for (
auto &die : variable_dies) {
3746 return variable_dies.size();
3754 if (child.Tag() != DW_TAG_call_site_parameter &&
3755 child.Tag() != DW_TAG_GNU_call_site_parameter)
3758 llvm::Optional<DWARFExpression> LocationInCallee;
3759 llvm::Optional<DWARFExpression> LocationInCaller;
3762 const size_t num_attributes = child.GetAttributes(attributes);
3766 auto parse_simple_location =
3767 [&](
int attr_index) -> llvm::Optional<DWARFExpression> {
3773 auto data = child.GetData();
3781 for (
size_t i = 0; i < num_attributes; ++i) {
3783 if (attr == DW_AT_location)
3784 LocationInCallee = parse_simple_location(i);
3785 if (attr == DW_AT_call_value || attr == DW_AT_GNU_call_site_value)
3786 LocationInCaller = parse_simple_location(i);
3789 if (LocationInCallee && LocationInCaller) {
3791 parameters.push_back(param);
3798 std::vector<std::unique_ptr<lldb_private::CallEdge>>
3802 bool has_call_edges =
3805 if (!has_call_edges)
3809 LLDB_LOG(log,
"CollectCallEdges: Found call site info in {0}",
3817 std::vector<std::unique_ptr<CallEdge>> call_edges;
3819 if (child.Tag() != DW_TAG_call_site && child.Tag() != DW_TAG_GNU_call_site)
3822 llvm::Optional<DWARFDIE> call_origin;
3823 llvm::Optional<DWARFExpression> call_target;
3827 bool tail_call =
false;
3833 const size_t num_attributes =
3835 for (
size_t i = 0; i < num_attributes; ++i) {
3838 LLDB_LOG(log,
"CollectCallEdges: Could not extract TAG_call_site form");
3844 if (attr == DW_AT_call_tail_call || attr == DW_AT_GNU_tail_call)
3845 tail_call = form_value.
Boolean();
3848 if (attr == DW_AT_call_origin || attr == DW_AT_abstract_origin) {
3850 if (!call_origin->IsValid()) {
3851 LLDB_LOG(log,
"CollectCallEdges: Invalid call origin in {0}",
3857 if (attr == DW_AT_low_pc)
3858 low_pc = form_value.
Address();
3863 if (attr == DW_AT_call_return_pc)
3864 return_pc = form_value.
Address();
3869 if (attr == DW_AT_call_pc)
3870 call_inst_pc = form_value.
Address();
3874 if (attr == DW_AT_call_target || attr == DW_AT_GNU_call_site_target) {
3877 "CollectCallEdges: AT_call_target does not have block form");
3881 auto data = child.GetData();
3889 if (!call_origin && !call_target) {
3890 LLDB_LOG(log,
"CollectCallEdges: call site without any call target");
3897 caller_address = return_pc;
3898 caller_address_type = CallEdge::AddrType::AfterCall;
3900 caller_address = low_pc;
3901 caller_address_type = CallEdge::AddrType::AfterCall;
3903 caller_address = call_inst_pc;
3904 caller_address_type = CallEdge::AddrType::Call;
3906 LLDB_LOG(log,
"CollectCallEdges: No caller address");
3918 std::unique_ptr<CallEdge> edge;
3921 "CollectCallEdges: Found call origin: {0} (retn-PC: {1:x}) "
3923 call_origin->GetPubname(), return_pc, call_inst_pc);
3924 edge = std::make_unique<DirectCallEdge>(
3925 call_origin->GetMangledName(), caller_address_type, caller_address,
3926 tail_call, std::move(parameters));
3932 LLDB_LOG(log,
"CollectCallEdges: Found indirect call target: {0}",
3935 edge = std::make_unique<IndirectCallEdge>(
3936 *call_target, caller_address_type, caller_address, tail_call,
3937 std::move(parameters));
3940 if (log && parameters.size()) {
3943 param.LocationInCallee.GetDescription(&callee_loc_desc,
3945 param.LocationInCaller.GetDescription(&caller_loc_desc,
3947 LLDB_LOG(log,
"CollectCallEdges: \tparam: {0} => {1}",
3952 call_edges.push_back(std::move(edge));
3957 std::vector<std::unique_ptr<lldb_private::CallEdge>>
3971 SymbolFileCommon::Dump(s);
3980 llvm::dyn_cast_or_null<TypeSystemClang>(&ts_or_err.get());
3991 module_sp->GetSymbolFile()->GetBackingSymbolFile());
4004 FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
4006 Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
4007 if (FileSystem::Instance().Exists(dwp_filespec)) {
4008 DataBufferSP dwp_file_data_sp;
4010 ObjectFileSP dwp_obj_file = ObjectFile::FindPlugin(
4012 FileSystem::Instance().GetByteSize(dwp_filespec), dwp_file_data_sp,
4013 dwp_file_data_offset);
4017 std::make_shared<SymbolFileDWARFDwo>(*
this, dwp_obj_file, 0x3fffffff);
4029 if (
auto err = type_system_or_err.takeError()) {
4031 "Unable to get DWARFASTParser");
4034 return type_system_or_err->GetDWARFParser();
4039 return dwarf_ast->GetDeclForUIDFromDWARF(die);
4045 return dwarf_ast->GetDeclContextForUIDFromDWARF(die);
4052 return dwarf_ast->GetDeclContextContainingUIDFromDWARF(die);
4062 return dwarf_decl_ctx;
4069 case DW_LANG_Mips_Assembler:
4071 case DW_LANG_GOOGLE_RenderScript:
4084 if (llvm::dwarf::isCPlusPlus(lang))
4085 lang = DW_LANG_C_plus_plus;
4091 return m_index->GetIndexTime();