Extended function lookup to allow the user to
indicate whether inline functions are desired.
This allows the expression parser, for instance,
to filter out inlined functions when looking for
functions it can call.
llvm-svn: 150279
diff --git a/lldb/source/Core/AddressResolverName.cpp b/lldb/source/Core/AddressResolverName.cpp
index 8218700..091a02f 100644
--- a/lldb/source/Core/AddressResolverName.cpp
+++ b/lldb/source/Core/AddressResolverName.cpp
@@ -104,6 +104,7 @@
}
const bool include_symbols = false;
+ const bool include_inlines = true;
const bool append = false;
switch (m_match_type)
{
@@ -117,6 +118,7 @@
NULL,
eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeMethod | eFunctionNameTypeSelector,
include_symbols,
+ include_inlines,
append,
func_list);
}
@@ -130,6 +132,7 @@
sym_list);
context.module_sp->FindFunctions (m_regex,
include_symbols,
+ include_inlines,
append,
func_list);
}
diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp
index d6b19ac..cd694d6 100644
--- a/lldb/source/Core/Disassembler.cpp
+++ b/lldb/source/Core/Disassembler.cpp
@@ -165,6 +165,7 @@
if (name)
{
const bool include_symbols = true;
+ const bool include_inlines = true;
if (module)
{
module->FindFunctions (name,
@@ -174,6 +175,7 @@
eFunctionNameTypeMethod |
eFunctionNameTypeSelector,
include_symbols,
+ include_inlines,
true,
sc_list);
}
@@ -184,7 +186,8 @@
eFunctionNameTypeFull |
eFunctionNameTypeMethod |
eFunctionNameTypeSelector,
- include_symbols,
+ include_symbols,
+ include_inlines,
false,
sc_list);
}
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index c4d6284..707b651 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -504,7 +504,8 @@
Module::FindFunctions (const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
uint32_t name_type_mask,
- bool include_symbols,
+ bool include_symbols,
+ bool include_inlines,
bool append,
SymbolContextList& sc_list)
{
@@ -516,7 +517,7 @@
// Find all the functions (not symbols, but debug information functions...
SymbolVendor *symbols = GetSymbolVendor ();
if (symbols)
- symbols->FindFunctions(name, namespace_decl, name_type_mask, append, sc_list);
+ symbols->FindFunctions(name, namespace_decl, name_type_mask, include_inlines, append, sc_list);
// Now check our symbol table for symbols that are code symbols if requested
if (include_symbols)
@@ -548,7 +549,8 @@
uint32_t
Module::FindFunctions (const RegularExpression& regex,
- bool include_symbols,
+ bool include_symbols,
+ bool include_inlines,
bool append,
SymbolContextList& sc_list)
{
@@ -559,7 +561,7 @@
SymbolVendor *symbols = GetSymbolVendor ();
if (symbols)
- symbols->FindFunctions(regex, append, sc_list);
+ symbols->FindFunctions(regex, include_inlines, append, sc_list);
// Now check our symbol table for symbols that are code symbols if requested
if (include_symbols)
{
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index 8f372c5..360c868 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -186,6 +186,7 @@
ModuleList::FindFunctions (const ConstString &name,
uint32_t name_type_mask,
bool include_symbols,
+ bool include_inlines,
bool append,
SymbolContextList &sc_list)
{
@@ -196,7 +197,7 @@
collection::const_iterator pos, end = m_modules.end();
for (pos = m_modules.begin(); pos != end; ++pos)
{
- (*pos)->FindFunctions (name, NULL, name_type_mask, include_symbols, true, sc_list);
+ (*pos)->FindFunctions (name, NULL, name_type_mask, include_symbols, include_inlines, true, sc_list);
}
return sc_list.GetSize();
diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp
index de24b1e..4d077b3 100644
--- a/lldb/source/Core/SourceManager.cpp
+++ b/lldb/source/Core/SourceManager.cpp
@@ -245,8 +245,9 @@
uint32_t num_matches;
ConstString main_name("main");
bool symbols_okay = false; // Force it to be a debug symbol.
+ bool inlines_okay = true;
bool append = false;
- num_matches = executable_ptr->FindFunctions (main_name, NULL, lldb::eFunctionNameTypeBase, symbols_okay, append, sc_list);
+ num_matches = executable_ptr->FindFunctions (main_name, NULL, lldb::eFunctionNameTypeBase, inlines_okay, symbols_okay, append, sc_list);
for (uint32_t idx = 0; idx < num_matches; idx++)
{
SymbolContext sc;