summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/SymbolFile')
-rw-r--r--lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp16
-rw-r--r--lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h23
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp74
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h26
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp81
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h26
-rw-r--r--lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp19
-rw-r--r--lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h21
-rw-r--r--lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp56
-rw-r--r--lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h26
10 files changed, 144 insertions, 224 deletions
diff --git a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
index bed066f31e2..f84cf0c5368 100644
--- a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
+++ b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
@@ -289,23 +289,17 @@ uint32_t SymbolFileBreakpad::ResolveSymbolContext(
return sc_list.GetSize() - old_size;
}
-uint32_t SymbolFileBreakpad::FindFunctions(
+void SymbolFileBreakpad::FindFunctions(
ConstString name, const CompilerDeclContext *parent_decl_ctx,
- FunctionNameType name_type_mask, bool include_inlines, bool append,
+ FunctionNameType name_type_mask, bool include_inlines,
SymbolContextList &sc_list) {
// TODO
- if (!append)
- sc_list.Clear();
- return sc_list.GetSize();
}
-uint32_t SymbolFileBreakpad::FindFunctions(const RegularExpression &regex,
- bool include_inlines, bool append,
- SymbolContextList &sc_list) {
+void SymbolFileBreakpad::FindFunctions(const RegularExpression &regex,
+ bool include_inlines,
+ SymbolContextList &sc_list) {
// TODO
- if (!append)
- sc_list.Clear();
- return sc_list.GetSize();
}
void SymbolFileBreakpad::FindTypes(
diff --git a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
index 8906e4bfa25..a10138cdf92 100644
--- a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
+++ b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
@@ -70,12 +70,10 @@ public:
size_t ParseBlocksRecursive(Function &func) override { return 0; }
- uint32_t FindGlobalVariables(ConstString name,
- const CompilerDeclContext *parent_decl_ctx,
- uint32_t max_matches,
- VariableList &variables) override {
- return 0;
- }
+ void FindGlobalVariables(ConstString name,
+ const CompilerDeclContext *parent_decl_ctx,
+ uint32_t max_matches,
+ VariableList &variables) override {}
size_t ParseVariablesForContext(const SymbolContext &sc) override {
return 0;
@@ -100,14 +98,13 @@ public:
void GetTypes(SymbolContextScope *sc_scope, lldb::TypeClass type_mask,
TypeList &type_list) override {}
- uint32_t FindFunctions(ConstString name,
- const CompilerDeclContext *parent_decl_ctx,
- lldb::FunctionNameType name_type_mask,
- bool include_inlines, bool append,
- SymbolContextList &sc_list) override;
+ void FindFunctions(ConstString name,
+ const CompilerDeclContext *parent_decl_ctx,
+ lldb::FunctionNameType name_type_mask,
+ bool include_inlines, SymbolContextList &sc_list) override;
- uint32_t FindFunctions(const RegularExpression &regex, bool include_inlines,
- bool append, SymbolContextList &sc_list) override;
+ void FindFunctions(const RegularExpression &regex, bool include_inlines,
+ SymbolContextList &sc_list) override;
void FindTypes(ConstString name, const CompilerDeclContext *parent_decl_ctx,
uint32_t max_matches,
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 7d96e324ff9..c982d59c283 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2005,7 +2005,7 @@ bool SymbolFileDWARF::DeclContextMatchesThisSymbolFile(
return false;
}
-uint32_t SymbolFileDWARF::FindGlobalVariables(
+void SymbolFileDWARF::FindGlobalVariables(
ConstString name, const CompilerDeclContext *parent_decl_ctx,
uint32_t max_matches, VariableList &variables) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
@@ -2020,11 +2020,11 @@ uint32_t SymbolFileDWARF::FindGlobalVariables(
max_matches);
if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx))
- return 0;
+ return;
DWARFDebugInfo *info = DebugInfo();
- if (info == nullptr)
- return 0;
+ if (!info)
+ return;
// Remember how many variables are in the list before we search.
const uint32_t original_size = variables.GetSize();
@@ -2111,12 +2111,11 @@ uint32_t SymbolFileDWARF::FindGlobalVariables(
name.GetCString(), static_cast<const void *>(parent_decl_ctx),
max_matches, num_matches);
}
- return num_matches;
}
-uint32_t SymbolFileDWARF::FindGlobalVariables(const RegularExpression &regex,
- uint32_t max_matches,
- VariableList &variables) {
+void SymbolFileDWARF::FindGlobalVariables(const RegularExpression &regex,
+ uint32_t max_matches,
+ VariableList &variables) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
@@ -2129,8 +2128,8 @@ uint32_t SymbolFileDWARF::FindGlobalVariables(const RegularExpression &regex,
}
DWARFDebugInfo *info = DebugInfo();
- if (info == nullptr)
- return 0;
+ if (!info)
+ return;
// Remember how many variables are in the list before we search.
const uint32_t original_size = variables.GetSize();
@@ -2163,9 +2162,6 @@ uint32_t SymbolFileDWARF::FindGlobalVariables(const RegularExpression &regex,
m_index->ReportInvalidDIERef(die_ref, regex.GetText());
}
}
-
- // Return the number of variable that were appended to the list
- return variables.GetSize() - original_size;
}
bool SymbolFileDWARF::ResolveFunction(const DWARFDIE &orig_die,
@@ -2241,10 +2237,11 @@ bool SymbolFileDWARF::DIEInDeclContext(const CompilerDeclContext *decl_ctx,
return false;
}
-uint32_t SymbolFileDWARF::FindFunctions(
- ConstString name, const CompilerDeclContext *parent_decl_ctx,
- FunctionNameType name_type_mask, bool include_inlines, bool append,
- SymbolContextList &sc_list) {
+void SymbolFileDWARF::FindFunctions(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());
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, "SymbolFileDWARF::FindFunctions (name = '%s')",
@@ -2259,21 +2256,16 @@ uint32_t SymbolFileDWARF::FindFunctions(
if (log) {
GetObjectFile()->GetModule()->LogMessage(
log,
- "SymbolFileDWARF::FindFunctions (name=\"%s\", "
- "name_type_mask=0x%x, append=%u, sc_list)",
- name.GetCString(), name_type_mask, append);
+ "SymbolFileDWARF::FindFunctions (name=\"%s\", name_type_mask=0x%x, sc_list)",
+ name.GetCString(), name_type_mask);
}
- // If we aren't appending the results to this list, then clear the list
- if (!append)
- sc_list.Clear();
-
if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx))
- return 0;
+ return;
// If name is empty then we won't find anything.
if (name.IsEmpty())
- return 0;
+ return;
// Remember how many sc_list are in the list before we search in case we are
// appending the results to a variable list.
@@ -2300,17 +2292,15 @@ uint32_t SymbolFileDWARF::FindFunctions(
GetObjectFile()->GetModule()->LogMessage(
log,
"SymbolFileDWARF::FindFunctions (name=\"%s\", "
- "name_type_mask=0x%x, include_inlines=%d, append=%u, sc_list) => "
- "%u",
- name.GetCString(), name_type_mask, include_inlines, append,
+ "name_type_mask=0x%x, include_inlines=%d, sc_list) => %u",
+ name.GetCString(), name_type_mask, include_inlines,
num_matches);
}
- return num_matches;
}
-uint32_t SymbolFileDWARF::FindFunctions(const RegularExpression &regex,
- bool include_inlines, bool append,
- SymbolContextList &sc_list) {
+void SymbolFileDWARF::FindFunctions(const RegularExpression &regex,
+ bool include_inlines,
+ SymbolContextList &sc_list) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, "SymbolFileDWARF::FindFunctions (regex = '%s')",
@@ -2320,22 +2310,13 @@ uint32_t SymbolFileDWARF::FindFunctions(const RegularExpression &regex,
if (log) {
GetObjectFile()->GetModule()->LogMessage(
- log,
- "SymbolFileDWARF::FindFunctions (regex=\"%s\", append=%u, sc_list)",
- regex.GetText().str().c_str(), append);
+ log, "SymbolFileDWARF::FindFunctions (regex=\"%s\", sc_list)",
+ regex.GetText().str().c_str());
}
- // If we aren't appending the results to this list, then clear the list
- if (!append)
- sc_list.Clear();
-
DWARFDebugInfo *info = DebugInfo();
if (!info)
- return 0;
-
- // Remember how many sc_list are in the list before we search in case we are
- // appending the results to a variable list.
- uint32_t original_size = sc_list.GetSize();
+ return;
DIEArray offsets;
m_index->GetFunctions(regex, offsets);
@@ -2350,9 +2331,6 @@ uint32_t SymbolFileDWARF::FindFunctions(const RegularExpression &regex,
if (resolved_dies.insert(die.GetDIE()).second)
ResolveFunction(die, include_inlines, sc_list);
}
-
- // Return the number of variable that were appended to the list
- return sc_list.GetSize() - original_size;
}
void SymbolFileDWARF::GetMangledNamesForFunction(
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
index 4f04d416eac..04cb11d426b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -157,25 +157,25 @@ public:
lldb::SymbolContextItem resolve_scope,
lldb_private::SymbolContextList &sc_list) override;
- uint32_t
+ void
FindGlobalVariables(lldb_private::ConstString name,
const lldb_private::CompilerDeclContext *parent_decl_ctx,
uint32_t max_matches,
lldb_private::VariableList &variables) override;
- uint32_t FindGlobalVariables(const lldb_private::RegularExpression &regex,
- uint32_t max_matches,
- lldb_private::VariableList &variables) override;
+ void FindGlobalVariables(const lldb_private::RegularExpression &regex,
+ uint32_t max_matches,
+ lldb_private::VariableList &variables) override;
- uint32_t
- FindFunctions(lldb_private::ConstString name,
- const lldb_private::CompilerDeclContext *parent_decl_ctx,
- lldb::FunctionNameType name_type_mask, bool include_inlines,
- bool append, lldb_private::SymbolContextList &sc_list) override;
-
- uint32_t FindFunctions(const lldb_private::RegularExpression &regex,
- bool include_inlines, bool append,
- lldb_private::SymbolContextList &sc_list) override;
+ void FindFunctions(lldb_private::ConstString name,
+ const lldb_private::CompilerDeclContext *parent_decl_ctx,
+ lldb::FunctionNameType name_type_mask,
+ bool include_inlines,
+ lldb_private::SymbolContextList &sc_list) override;
+
+ void FindFunctions(const lldb_private::RegularExpression &regex,
+ bool include_inlines,
+ lldb_private::SymbolContextList &sc_list) override;
void GetMangledNamesForFunction(
const std::string &scope_qualified_name,
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index c286dc90e5d..a50d4e460ba 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -824,12 +824,11 @@ uint32_t SymbolFileDWARFDebugMap::ResolveSymbolContext(
return sc_list.GetSize() - initial;
}
-uint32_t SymbolFileDWARFDebugMap::PrivateFindGlobalVariables(
+void SymbolFileDWARFDebugMap::PrivateFindGlobalVariables(
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) {
- const uint32_t original_size = variables.GetSize();
const size_t match_count = indexes.size();
for (size_t i = 0; i < match_count; ++i) {
uint32_t oso_idx;
@@ -838,29 +837,26 @@ uint32_t SymbolFileDWARFDebugMap::PrivateFindGlobalVariables(
if (comp_unit_info) {
SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
if (oso_dwarf) {
- if (oso_dwarf->FindGlobalVariables(name, parent_decl_ctx, max_matches,
- variables))
- if (variables.GetSize() > max_matches)
- break;
+ oso_dwarf->FindGlobalVariables(name, parent_decl_ctx, max_matches,
+ variables);
+ if (variables.GetSize() > max_matches)
+ break;
}
}
}
- return variables.GetSize() - original_size;
}
-uint32_t SymbolFileDWARFDebugMap::FindGlobalVariables(
+void SymbolFileDWARFDebugMap::FindGlobalVariables(
ConstString name, const CompilerDeclContext *parent_decl_ctx,
uint32_t max_matches, VariableList &variables) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
-
- // Remember how many variables are in the list before we search.
- const uint32_t original_size = variables.GetSize();
-
uint32_t total_matches = 0;
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
- const uint32_t oso_matches = oso_dwarf->FindGlobalVariables(
- name, parent_decl_ctx, max_matches, variables);
+ const uint32_t old_size = variables.GetSize();
+ oso_dwarf->FindGlobalVariables(name, parent_decl_ctx, max_matches,
+ variables);
+ const uint32_t oso_matches = variables.GetSize() - old_size;
if (oso_matches > 0) {
total_matches += oso_matches;
@@ -879,23 +875,18 @@ uint32_t SymbolFileDWARFDebugMap::FindGlobalVariables(
return false;
});
-
- // Return the number of variable that were appended to the list
- return variables.GetSize() - original_size;
}
-uint32_t
-SymbolFileDWARFDebugMap::FindGlobalVariables(const RegularExpression &regex,
- uint32_t max_matches,
- VariableList &variables) {
+void SymbolFileDWARFDebugMap::FindGlobalVariables(
+ const RegularExpression &regex, uint32_t max_matches,
+ VariableList &variables) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
- // Remember how many variables are in the list before we search.
- const uint32_t original_size = variables.GetSize();
-
uint32_t total_matches = 0;
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
- const uint32_t oso_matches =
- oso_dwarf->FindGlobalVariables(regex, max_matches, variables);
+ const uint32_t old_size = variables.GetSize();
+ oso_dwarf->FindGlobalVariables(regex, max_matches, variables);
+
+ const uint32_t oso_matches = variables.GetSize() - old_size;
if (oso_matches > 0) {
total_matches += oso_matches;
@@ -914,9 +905,6 @@ SymbolFileDWARFDebugMap::FindGlobalVariables(const RegularExpression &regex,
return false;
});
-
- // Return the number of variable that were appended to the list
- return variables.GetSize() - original_size;
}
int SymbolFileDWARFDebugMap::SymbolContainsSymbolWithIndex(
@@ -1012,9 +1000,9 @@ static void RemoveFunctionsWithModuleNotEqualTo(const ModuleSP &module_sp,
}
}
-uint32_t SymbolFileDWARFDebugMap::FindFunctions(
+void SymbolFileDWARFDebugMap::FindFunctions(
ConstString name, const CompilerDeclContext *parent_decl_ctx,
- FunctionNameType name_type_mask, bool include_inlines, bool append,
+ FunctionNameType name_type_mask, bool include_inlines,
SymbolContextList &sc_list) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
@@ -1022,52 +1010,37 @@ uint32_t SymbolFileDWARFDebugMap::FindFunctions(
"SymbolFileDWARFDebugMap::FindFunctions (name = %s)",
name.GetCString());
- uint32_t initial_size = 0;
- if (append)
- initial_size = sc_list.GetSize();
- else
- sc_list.Clear();
-
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
uint32_t sc_idx = sc_list.GetSize();
- if (oso_dwarf->FindFunctions(name, parent_decl_ctx, name_type_mask,
- include_inlines, true, sc_list)) {
+ oso_dwarf->FindFunctions(name, parent_decl_ctx, name_type_mask,
+ include_inlines, sc_list);
+ if (!sc_list.IsEmpty()) {
RemoveFunctionsWithModuleNotEqualTo(m_objfile_sp->GetModule(), sc_list,
sc_idx);
}
return false;
});
-
- return sc_list.GetSize() - initial_size;
}
-uint32_t SymbolFileDWARFDebugMap::FindFunctions(const RegularExpression &regex,
- bool include_inlines,
- bool append,
- SymbolContextList &sc_list) {
+void SymbolFileDWARFDebugMap::FindFunctions(const RegularExpression &regex,
+ bool include_inlines,
+ SymbolContextList &sc_list) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat,
"SymbolFileDWARFDebugMap::FindFunctions (regex = '%s')",
regex.GetText().str().c_str());
- uint32_t initial_size = 0;
- if (append)
- initial_size = sc_list.GetSize();
- else
- sc_list.Clear();
-
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
uint32_t sc_idx = sc_list.GetSize();
- if (oso_dwarf->FindFunctions(regex, include_inlines, true, sc_list)) {
+ oso_dwarf->FindFunctions(regex, include_inlines, sc_list);
+ if (!sc_list.IsEmpty()) {
RemoveFunctionsWithModuleNotEqualTo(m_objfile_sp->GetModule(), sc_list,
sc_idx);
}
return false;
});
-
- return sc_list.GetSize() - initial_size;
}
void SymbolFileDWARFDebugMap::GetTypes(SymbolContextScope *sc_scope,
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
index 0643e6d24e6..7adee1b356c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
@@ -92,22 +92,22 @@ public:
bool check_inlines,
lldb::SymbolContextItem resolve_scope,
lldb_private::SymbolContextList &sc_list) override;
- uint32_t
+ void
FindGlobalVariables(lldb_private::ConstString name,
const lldb_private::CompilerDeclContext *parent_decl_ctx,
uint32_t max_matches,
lldb_private::VariableList &variables) override;
- uint32_t FindGlobalVariables(const lldb_private::RegularExpression &regex,
- uint32_t max_matches,
- lldb_private::VariableList &variables) override;
- uint32_t
- FindFunctions(lldb_private::ConstString name,
- const lldb_private::CompilerDeclContext *parent_decl_ctx,
- lldb::FunctionNameType name_type_mask, bool include_inlines,
- bool append, lldb_private::SymbolContextList &sc_list) override;
- uint32_t FindFunctions(const lldb_private::RegularExpression &regex,
- bool include_inlines, bool append,
- lldb_private::SymbolContextList &sc_list) override;
+ void FindGlobalVariables(const lldb_private::RegularExpression &regex,
+ uint32_t max_matches,
+ lldb_private::VariableList &variables) override;
+ void FindFunctions(lldb_private::ConstString name,
+ const lldb_private::CompilerDeclContext *parent_decl_ctx,
+ lldb::FunctionNameType name_type_mask,
+ bool include_inlines,
+ lldb_private::SymbolContextList &sc_list) override;
+ void FindFunctions(const lldb_private::RegularExpression &regex,
+ bool include_inlines,
+ lldb_private::SymbolContextList &sc_list) override;
void
FindTypes(lldb_private::ConstString name,
const lldb_private::CompilerDeclContext *parent_decl_ctx,
@@ -236,7 +236,7 @@ protected:
static int SymbolContainsSymbolWithID(lldb::user_id_t *symbol_idx_ptr,
const CompileUnitInfo *comp_unit_info);
- uint32_t PrivateFindGlobalVariables(
+ void PrivateFindGlobalVariables(
lldb_private::ConstString name,
const lldb_private::CompilerDeclContext *parent_decl_ctx,
const std::vector<uint32_t> &name_symbol_indexes, uint32_t max_matches,
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
index bb2cfc2aa5e..33b8da3b543 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
@@ -1179,7 +1179,7 @@ size_t SymbolFileNativePDB::ParseBlocksRecursive(Function &func) {
void SymbolFileNativePDB::DumpClangAST(Stream &s) { m_ast->Dump(s); }
-uint32_t SymbolFileNativePDB::FindGlobalVariables(
+void SymbolFileNativePDB::FindGlobalVariables(
ConstString name, const CompilerDeclContext *parent_decl_ctx,
uint32_t max_matches, VariableList &variables) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
@@ -1204,17 +1204,16 @@ uint32_t SymbolFileNativePDB::FindGlobalVariables(
continue;
}
}
- return variables.GetSize();
}
-uint32_t SymbolFileNativePDB::FindFunctions(
+void SymbolFileNativePDB::FindFunctions(
ConstString name, const CompilerDeclContext *parent_decl_ctx,
- FunctionNameType name_type_mask, bool include_inlines, bool append,
+ FunctionNameType name_type_mask, bool include_inlines,
SymbolContextList &sc_list) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
// For now we only support lookup by method name.
if (!(name_type_mask & eFunctionNameTypeMethod))
- return 0;
+ return;
using SymbolAndOffset = std::pair<uint32_t, llvm::codeview::CVSymbol>;
@@ -1239,15 +1238,11 @@ uint32_t SymbolFileNativePDB::FindFunctions(
sc_list.Append(sc);
}
-
- return sc_list.GetSize();
}
-uint32_t SymbolFileNativePDB::FindFunctions(const RegularExpression &regex,
- bool include_inlines, bool append,
- SymbolContextList &sc_list) {
- return 0;
-}
+void SymbolFileNativePDB::FindFunctions(const RegularExpression &regex,
+ bool include_inlines,
+ SymbolContextList &sc_list) {}
void SymbolFileNativePDB::FindTypes(
ConstString name, const CompilerDeclContext *parent_decl_ctx,
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
index 79908a60127..ca7de0e7d1e 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
@@ -88,10 +88,10 @@ public:
size_t ParseBlocksRecursive(Function &func) override;
- uint32_t FindGlobalVariables(ConstString name,
- const CompilerDeclContext *parent_decl_ctx,
- uint32_t max_matches,
- VariableList &variables) override;
+ void FindGlobalVariables(ConstString name,
+ const CompilerDeclContext *parent_decl_ctx,
+ uint32_t max_matches,
+ VariableList &variables) override;
size_t ParseVariablesForContext(const SymbolContext &sc) override;
@@ -117,14 +117,13 @@ public:
void GetTypes(SymbolContextScope *sc_scope, lldb::TypeClass type_mask,
TypeList &type_list) override;
- uint32_t FindFunctions(ConstString name,
- const CompilerDeclContext *parent_decl_ctx,
- lldb::FunctionNameType name_type_mask,
- bool include_inlines, bool append,
- SymbolContextList &sc_list) override;
+ void FindFunctions(ConstString name,
+ const CompilerDeclContext *parent_decl_ctx,
+ lldb::FunctionNameType name_type_mask,
+ bool include_inlines, SymbolContextList &sc_list) override;
- uint32_t FindFunctions(const RegularExpression &regex, bool include_inlines,
- bool append, SymbolContextList &sc_list) override;
+ void FindFunctions(const RegularExpression &regex, bool include_inlines,
+ SymbolContextList &sc_list) override;
void FindTypes(ConstString name, const CompilerDeclContext *parent_decl_ctx,
uint32_t max_matches,
diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
index 5d74b2537e6..0dac6fdb807 100644
--- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
+++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
@@ -1097,19 +1097,19 @@ SymbolFilePDB::ParseVariables(const lldb_private::SymbolContext &sc,
return num_added;
}
-uint32_t SymbolFilePDB::FindGlobalVariables(
+void SymbolFilePDB::FindGlobalVariables(
lldb_private::ConstString name,
const lldb_private::CompilerDeclContext *parent_decl_ctx,
uint32_t max_matches, lldb_private::VariableList &variables) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx))
- return 0;
+ return;
if (name.IsEmpty())
- return 0;
+ return;
auto results = m_global_scope_up->findAllChildren<PDBSymbolData>();
if (!results)
- return 0;
+ return;
uint32_t matches = 0;
size_t old_size = variables.GetSize();
@@ -1138,20 +1138,17 @@ uint32_t SymbolFilePDB::FindGlobalVariables(
ParseVariables(sc, *pdb_data, &variables);
matches = variables.GetSize() - old_size;
}
-
- return matches;
}
-uint32_t
-SymbolFilePDB::FindGlobalVariables(const lldb_private::RegularExpression &regex,
- uint32_t max_matches,
- lldb_private::VariableList &variables) {
+void SymbolFilePDB::FindGlobalVariables(
+ const lldb_private::RegularExpression &regex, uint32_t max_matches,
+ lldb_private::VariableList &variables) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
if (!regex.IsValid())
- return 0;
+ return;
auto results = m_global_scope_up->findAllChildren<PDBSymbolData>();
if (!results)
- return 0;
+ return;
uint32_t matches = 0;
size_t old_size = variables.GetSize();
@@ -1176,8 +1173,6 @@ SymbolFilePDB::FindGlobalVariables(const lldb_private::RegularExpression &regex,
ParseVariables(sc, *pdb_data, &variables);
matches = variables.GetSize() - old_size;
}
-
- return matches;
}
bool SymbolFilePDB::ResolveFunction(const llvm::pdb::PDBSymbolFunc &pdb_func,
@@ -1299,24 +1294,21 @@ void SymbolFilePDB::CacheFunctionNames() {
m_func_base_names.SizeToFit();
}
-uint32_t SymbolFilePDB::FindFunctions(
+void SymbolFilePDB::FindFunctions(
lldb_private::ConstString name,
const lldb_private::CompilerDeclContext *parent_decl_ctx,
- FunctionNameType name_type_mask, bool include_inlines, bool append,
+ FunctionNameType name_type_mask, bool include_inlines,
lldb_private::SymbolContextList &sc_list) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
- if (!append)
- sc_list.Clear();
lldbassert((name_type_mask & eFunctionNameTypeAuto) == 0);
if (name_type_mask == eFunctionNameTypeNone)
- return 0;
+ return;
if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx))
- return 0;
+ return;
if (name.IsEmpty())
- return 0;
+ return;
- auto old_size = sc_list.GetSize();
if (name_type_mask & eFunctionNameTypeFull ||
name_type_mask & eFunctionNameTypeBase ||
name_type_mask & eFunctionNameTypeMethod) {
@@ -1346,25 +1338,19 @@ uint32_t SymbolFilePDB::FindFunctions(
ResolveFn(m_func_base_names);
ResolveFn(m_func_method_names);
}
- if (name_type_mask & eFunctionNameTypeBase) {
+ if (name_type_mask & eFunctionNameTypeBase)
ResolveFn(m_func_base_names);
- }
- if (name_type_mask & eFunctionNameTypeMethod) {
+ if (name_type_mask & eFunctionNameTypeMethod)
ResolveFn(m_func_method_names);
- }
}
- return sc_list.GetSize() - old_size;
}
-uint32_t
-SymbolFilePDB::FindFunctions(const lldb_private::RegularExpression &regex,
- bool include_inlines, bool append,
- lldb_private::SymbolContextList &sc_list) {
+void SymbolFilePDB::FindFunctions(const lldb_private::RegularExpression &regex,
+ bool include_inlines,
+ lldb_private::SymbolContextList &sc_list) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
- if (!append)
- sc_list.Clear();
if (!regex.IsValid())
- return 0;
+ return;
auto old_size = sc_list.GetSize();
CacheFunctionNames();
@@ -1383,8 +1369,6 @@ SymbolFilePDB::FindFunctions(const lldb_private::RegularExpression &regex,
};
ResolveFn(m_func_full_names);
ResolveFn(m_func_base_names);
-
- return sc_list.GetSize() - old_size;
}
void SymbolFilePDB::GetMangledNamesForFunction(
diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
index 1fdacf0c825..df717bbbbdb 100644
--- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
+++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
@@ -99,25 +99,25 @@ public:
lldb::SymbolContextItem resolve_scope,
lldb_private::SymbolContextList &sc_list) override;
- uint32_t
+ void
FindGlobalVariables(lldb_private::ConstString name,
const lldb_private::CompilerDeclContext *parent_decl_ctx,
uint32_t max_matches,
lldb_private::VariableList &variables) override;
- uint32_t FindGlobalVariables(const lldb_private::RegularExpression &regex,
- uint32_t max_matches,
- lldb_private::VariableList &variables) override;
+ void FindGlobalVariables(const lldb_private::RegularExpression &regex,
+ uint32_t max_matches,
+ lldb_private::VariableList &variables) override;
- uint32_t
- FindFunctions(lldb_private::ConstString name,
- const lldb_private::CompilerDeclContext *parent_decl_ctx,
- lldb::FunctionNameType name_type_mask, bool include_inlines,
- bool append, lldb_private::SymbolContextList &sc_list) override;
-
- uint32_t FindFunctions(const lldb_private::RegularExpression &regex,
- bool include_inlines, bool append,
- lldb_private::SymbolContextList &sc_list) override;
+ void FindFunctions(lldb_private::ConstString name,
+ const lldb_private::CompilerDeclContext *parent_decl_ctx,
+ lldb::FunctionNameType name_type_mask,
+ bool include_inlines,
+ lldb_private::SymbolContextList &sc_list) override;
+
+ void FindFunctions(const lldb_private::RegularExpression &regex,
+ bool include_inlines,
+ lldb_private::SymbolContextList &sc_list) override;
void GetMangledNamesForFunction(
const std::string &scope_qualified_name,
OpenPOWER on IntegriCloud