[lldb] Allow SymbolTable regex search functions to match mangled name

It may be useful to search symbol table entries by mangled instead
of demangled names. Add this optional functionality in the SymbolTable
functions.

Differential Revision: https://reviews.llvm.org/D130803
This commit is contained in:
Augusto Noronha
2022-07-29 15:19:17 -07:00
parent f23076f6c5
commit 3aef968ec3
8 changed files with 191 additions and 19 deletions

View File

@@ -1367,9 +1367,9 @@ void Module::FindSymbolsWithNameAndType(ConstString name,
}
}
void Module::FindSymbolsMatchingRegExAndType(const RegularExpression &regex,
SymbolType symbol_type,
SymbolContextList &sc_list) {
void Module::FindSymbolsMatchingRegExAndType(
const RegularExpression &regex, SymbolType symbol_type,
SymbolContextList &sc_list, Mangled::NamePreference mangling_preference) {
// No need to protect this call using m_mutex all other method calls are
// already thread safe.
LLDB_SCOPED_TIMERF(
@@ -1379,7 +1379,7 @@ void Module::FindSymbolsMatchingRegExAndType(const RegularExpression &regex,
std::vector<uint32_t> symbol_indexes;
symtab->FindAllSymbolsMatchingRexExAndType(
regex, symbol_type, Symtab::eDebugAny, Symtab::eVisibilityAny,
symbol_indexes);
symbol_indexes, mangling_preference);
SymbolIndicesToSymbolContextList(symtab, symbol_indexes, sc_list);
}
}