diff options
Diffstat (limited to 'lldb/source/Plugins/SymbolFile')
6 files changed, 32 insertions, 51 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index b8f5e60b17b..f6abfdc0c25 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1968,14 +1968,15 @@ bool SymbolFileDWARF::DeclContextMatchesThisSymbolFile( uint32_t SymbolFileDWARF::FindGlobalVariables( const ConstString &name, const CompilerDeclContext *parent_decl_ctx, - bool append, uint32_t max_matches, VariableList &variables) { + uint32_t max_matches, VariableList &variables) { Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS)); if (log) GetObjectFile()->GetModule()->LogMessage( - log, "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", " - "parent_decl_ctx=%p, append=%u, max_matches=%u, variables)", - name.GetCString(), static_cast<const void *>(parent_decl_ctx), append, + log, + "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", " + "parent_decl_ctx=%p, max_matches=%u, variables)", + name.GetCString(), static_cast<const void *>(parent_decl_ctx), max_matches); if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx)) @@ -1985,12 +1986,7 @@ uint32_t SymbolFileDWARF::FindGlobalVariables( if (info == NULL) return 0; - // If we aren't appending the results to this list, then clear the list - if (!append) - variables.Clear(); - - // Remember how many variables are in the list before we search in case we - // are appending the results to a variable list. + // Remember how many variables are in the list before we search. const uint32_t original_size = variables.GetSize(); DIEArray die_offsets; @@ -2047,36 +2043,33 @@ uint32_t SymbolFileDWARF::FindGlobalVariables( const uint32_t num_matches = variables.GetSize() - original_size; if (log && num_matches > 0) { GetObjectFile()->GetModule()->LogMessage( - log, "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", " - "parent_decl_ctx=%p, append=%u, max_matches=%u, variables) => %u", - name.GetCString(), static_cast<const void *>(parent_decl_ctx), append, + log, + "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", " + "parent_decl_ctx=%p, max_matches=%u, variables) => %u", + name.GetCString(), static_cast<const void *>(parent_decl_ctx), max_matches, num_matches); } return num_matches; } uint32_t SymbolFileDWARF::FindGlobalVariables(const RegularExpression ®ex, - bool append, uint32_t max_matches, + uint32_t max_matches, VariableList &variables) { Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS)); if (log) { GetObjectFile()->GetModule()->LogMessage( - log, "SymbolFileDWARF::FindGlobalVariables (regex=\"%s\", append=%u, " - "max_matches=%u, variables)", - regex.GetText().str().c_str(), append, max_matches); + log, + "SymbolFileDWARF::FindGlobalVariables (regex=\"%s\", " + "max_matches=%u, variables)", + regex.GetText().str().c_str(), max_matches); } DWARFDebugInfo *info = DebugInfo(); if (info == NULL) return 0; - // If we aren't appending the results to this list, then clear the list - if (!append) - variables.Clear(); - - // Remember how many variables are in the list before we search in case we - // are appending the results to a variable list. + // Remember how many variables are in the list before we search. const uint32_t original_size = variables.GetSize(); DIEArray die_offsets; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h index 3eb87fc96da..1eabe983e23 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -179,11 +179,11 @@ public: uint32_t FindGlobalVariables(const lldb_private::ConstString &name, const lldb_private::CompilerDeclContext *parent_decl_ctx, - bool append, uint32_t max_matches, + uint32_t max_matches, lldb_private::VariableList &variables) override; uint32_t FindGlobalVariables(const lldb_private::RegularExpression ®ex, - bool append, uint32_t max_matches, + uint32_t max_matches, lldb_private::VariableList &variables) override; uint32_t diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index 0d7fd321ed0..e2811e895e8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -801,8 +801,8 @@ 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, true, - max_matches, variables)) + if (oso_dwarf->FindGlobalVariables(name, parent_decl_ctx, max_matches, + variables)) if (variables.GetSize() > max_matches) break; } @@ -813,21 +813,16 @@ uint32_t SymbolFileDWARFDebugMap::PrivateFindGlobalVariables( uint32_t SymbolFileDWARFDebugMap::FindGlobalVariables( const ConstString &name, const CompilerDeclContext *parent_decl_ctx, - bool append, uint32_t max_matches, VariableList &variables) { + uint32_t max_matches, VariableList &variables) { - // If we aren't appending the results to this list, then clear the list - if (!append) - variables.Clear(); - - // Remember how many variables are in the list before we search in case we - // are appending the results to a variable list. + // 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, true, max_matches, variables); + name, parent_decl_ctx, max_matches, variables); if (oso_matches > 0) { total_matches += oso_matches; @@ -853,20 +848,15 @@ uint32_t SymbolFileDWARFDebugMap::FindGlobalVariables( uint32_t SymbolFileDWARFDebugMap::FindGlobalVariables(const RegularExpression ®ex, - bool append, uint32_t max_matches, + uint32_t max_matches, VariableList &variables) { - // If we aren't appending the results to this list, then clear the list - if (!append) - variables.Clear(); - - // Remember how many variables are in the list before we search in case we - // are appending the results to a variable list. + // 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, true, max_matches, variables); + oso_dwarf->FindGlobalVariables(regex, max_matches, variables); if (oso_matches > 0) { total_matches += oso_matches; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h index 04599eb0c26..5042d87970b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h @@ -95,10 +95,10 @@ public: uint32_t FindGlobalVariables(const lldb_private::ConstString &name, const lldb_private::CompilerDeclContext *parent_decl_ctx, - bool append, uint32_t max_matches, + uint32_t max_matches, lldb_private::VariableList &variables) override; uint32_t FindGlobalVariables(const lldb_private::RegularExpression ®ex, - bool append, uint32_t max_matches, + uint32_t max_matches, lldb_private::VariableList &variables) override; uint32_t FindFunctions(const lldb_private::ConstString &name, diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp index e490433fac0..f298749f10d 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp @@ -949,10 +949,8 @@ SymbolFilePDB::ParseVariables(const lldb_private::SymbolContext &sc, uint32_t SymbolFilePDB::FindGlobalVariables( const lldb_private::ConstString &name, - const lldb_private::CompilerDeclContext *parent_decl_ctx, bool append, + const lldb_private::CompilerDeclContext *parent_decl_ctx, uint32_t max_matches, lldb_private::VariableList &variables) { - if (!append) - variables.Clear(); if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx)) return 0; if (name.IsEmpty()) @@ -989,7 +987,7 @@ uint32_t SymbolFilePDB::FindGlobalVariables( uint32_t SymbolFilePDB::FindGlobalVariables(const lldb_private::RegularExpression ®ex, - bool append, uint32_t max_matches, + uint32_t max_matches, lldb_private::VariableList &variables) { if (!regex.IsValid()) return 0; diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h index 177eef9d5e9..96b62d68a6c 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h +++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h @@ -111,11 +111,11 @@ public: uint32_t FindGlobalVariables(const lldb_private::ConstString &name, const lldb_private::CompilerDeclContext *parent_decl_ctx, - bool append, uint32_t max_matches, + uint32_t max_matches, lldb_private::VariableList &variables) override; uint32_t FindGlobalVariables(const lldb_private::RegularExpression ®ex, - bool append, uint32_t max_matches, + uint32_t max_matches, lldb_private::VariableList &variables) override; uint32_t |