summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp32
1 files changed, 21 insertions, 11 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index cce666a222d0..6515d78b8f23 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -1,4 +1,4 @@
-//===-- SymbolFileDWARFDebugMap.cpp -----------------------------*- C++ -*-===//
+//===-- SymbolFileDWARFDebugMap.cpp ---------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -108,8 +108,7 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(
// First we find the original symbol in the .o file's symbol table
Symbol *oso_fun_symbol = oso_symtab->FindFirstSymbolWithNameAndType(
- exe_symbol->GetMangled().GetName(lldb::eLanguageTypeUnknown,
- Mangled::ePreferMangled),
+ exe_symbol->GetMangled().GetName(Mangled::ePreferMangled),
eSymbolTypeCode, Symtab::eDebugNo, Symtab::eVisibilityAny);
if (oso_fun_symbol) {
// Add the inverse OSO file address to debug map entry mapping
@@ -139,8 +138,7 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(
// in the .o file
Symbol *oso_gsym_symbol =
oso_symtab->FindFirstSymbolWithNameAndType(
- exe_symbol->GetMangled().GetName(lldb::eLanguageTypeUnknown,
- Mangled::ePreferMangled),
+ exe_symbol->GetMangled().GetName(Mangled::ePreferMangled),
eSymbolTypeData, Symtab::eDebugNo, Symtab::eVisibilityAny);
if (exe_symbol && oso_gsym_symbol && exe_symbol->ValueIsAddress() &&
oso_gsym_symbol->ValueIsAddress()) {
@@ -416,6 +414,7 @@ Module *SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(
FileSpec oso_file(oso_path);
ConstString oso_object;
if (FileSystem::Instance().Exists(oso_file)) {
+ FileSystem::Instance().Collect(oso_file);
// The modification time returned by the FS can have a higher precision
// than the one from the CU.
auto oso_mod_time = std::chrono::time_point_cast<std::chrono::seconds>(
@@ -531,7 +530,7 @@ SymbolFileDWARF *
SymbolFileDWARFDebugMap::GetSymbolFileAsSymbolFileDWARF(SymbolFile *sym_file) {
if (sym_file &&
sym_file->GetPluginName() == SymbolFileDWARF::GetPluginNameStatic())
- return (SymbolFileDWARF *)sym_file;
+ return static_cast<SymbolFileDWARF *>(sym_file);
return nullptr;
}
@@ -630,6 +629,14 @@ SymbolFileDWARFDebugMap::ParseLanguage(CompileUnit &comp_unit) {
return eLanguageTypeUnknown;
}
+XcodeSDK SymbolFileDWARFDebugMap::ParseXcodeSDK(CompileUnit &comp_unit) {
+ std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
+ SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
+ if (oso_dwarf)
+ return oso_dwarf->ParseXcodeSDK(comp_unit);
+ return {};
+}
+
size_t SymbolFileDWARFDebugMap::ParseFunctions(CompileUnit &comp_unit) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
@@ -826,7 +833,7 @@ uint32_t SymbolFileDWARFDebugMap::ResolveSymbolContext(
}
void SymbolFileDWARFDebugMap::PrivateFindGlobalVariables(
- ConstString name, const CompilerDeclContext *parent_decl_ctx,
+ ConstString name, const CompilerDeclContext &parent_decl_ctx,
const std::vector<uint32_t>
&indexes, // Indexes into the symbol table that match "name"
uint32_t max_matches, VariableList &variables) {
@@ -848,7 +855,7 @@ void SymbolFileDWARFDebugMap::PrivateFindGlobalVariables(
}
void SymbolFileDWARFDebugMap::FindGlobalVariables(
- ConstString name, const CompilerDeclContext *parent_decl_ctx,
+ ConstString name, const CompilerDeclContext &parent_decl_ctx,
uint32_t max_matches, VariableList &variables) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
uint32_t total_matches = 0;
@@ -1002,7 +1009,7 @@ static void RemoveFunctionsWithModuleNotEqualTo(const ModuleSP &module_sp,
}
void SymbolFileDWARFDebugMap::FindFunctions(
- ConstString name, const CompilerDeclContext *parent_decl_ctx,
+ ConstString name, const CompilerDeclContext &parent_decl_ctx,
FunctionNameType name_type_mask, bool include_inlines,
SymbolContextList &sc_list) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
@@ -1172,7 +1179,7 @@ TypeSP SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE(
}
void SymbolFileDWARFDebugMap::FindTypes(
- ConstString name, const CompilerDeclContext *parent_decl_ctx,
+ ConstString name, const CompilerDeclContext &parent_decl_ctx,
uint32_t max_matches,
llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
TypeMap &types) {
@@ -1209,7 +1216,7 @@ void SymbolFileDWARFDebugMap::FindTypes(
CompilerDeclContext SymbolFileDWARFDebugMap::FindNamespace(
lldb_private::ConstString name,
- const CompilerDeclContext *parent_decl_ctx) {
+ const CompilerDeclContext &parent_decl_ctx) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
CompilerDeclContext matching_namespace;
@@ -1225,6 +1232,9 @@ CompilerDeclContext SymbolFileDWARFDebugMap::FindNamespace(
void SymbolFileDWARFDebugMap::DumpClangAST(Stream &s) {
ForEachSymbolFile([&s](SymbolFileDWARF *oso_dwarf) -> bool {
oso_dwarf->DumpClangAST(s);
+ // The underlying assumption is that DumpClangAST(...) will obtain the
+ // AST from the underlying TypeSystem and therefore we only need to do
+ // this once and can stop after the first iteration hence we return true.
return true;
});
}