aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandCompletions.cpp8
-rw-r--r--lldb/source/Commands/CommandObjectDisassemble.cpp10
-rw-r--r--lldb/source/Commands/CommandObjectSource.cpp23
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp29
4 files changed, 39 insertions, 31 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp
index 55018cef..191c25f 100644
--- a/lldb/source/Commands/CommandCompletions.cpp
+++ b/lldb/source/Commands/CommandCompletions.cpp
@@ -213,10 +213,10 @@ public:
Address *addr) override {
if (context.module_sp) {
SymbolContextList sc_list;
- const bool include_symbols = true;
- const bool include_inlines = true;
- context.module_sp->FindFunctions(m_regex, include_symbols,
- include_inlines, sc_list);
+ ModuleFunctionSearchOptions function_options;
+ function_options.include_symbols = true;
+ function_options.include_inlines = true;
+ context.module_sp->FindFunctions(m_regex, function_options, sc_list);
SymbolContext sc;
// Now add the functions & symbols to the list - only add if unique:
diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp
index 5e73fb8..02a1662 100644
--- a/lldb/source/Commands/CommandObjectDisassemble.cpp
+++ b/lldb/source/Commands/CommandObjectDisassemble.cpp
@@ -322,13 +322,15 @@ CommandObjectDisassemble::GetCurrentLineRanges() {
llvm::Expected<std::vector<AddressRange>>
CommandObjectDisassemble::GetNameRanges(CommandReturnObject &result) {
ConstString name(m_options.func_name.c_str());
- const bool include_symbols = true;
- const bool include_inlines = true;
+
+ ModuleFunctionSearchOptions function_options;
+ function_options.include_symbols = true;
+ function_options.include_inlines = true;
// Find functions matching the given name.
SymbolContextList sc_list;
- GetSelectedTarget().GetImages().FindFunctions(
- name, eFunctionNameTypeAuto, include_symbols, include_inlines, sc_list);
+ GetSelectedTarget().GetImages().FindFunctions(name, eFunctionNameTypeAuto,
+ function_options, sc_list);
std::vector<AddressRange> ranges;
llvm::Error range_errs = llvm::Error::success();
diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp
index 7a0338e..fb33f41 100644
--- a/lldb/source/Commands/CommandObjectSource.cpp
+++ b/lldb/source/Commands/CommandObjectSource.cpp
@@ -374,13 +374,16 @@ protected:
Target *target = m_exe_ctx.GetTargetPtr();
uint32_t addr_byte_size = target->GetArchitecture().GetAddressByteSize();
+ ModuleFunctionSearchOptions function_options;
+ function_options.include_symbols = false;
+ function_options.include_inlines = true;
+
// Note: module_list can't be const& because FindFunctionSymbols isn't
// const.
ModuleList module_list =
(m_module_list.GetSize() > 0) ? m_module_list : target->GetImages();
- module_list.FindFunctions(name, eFunctionNameTypeAuto,
- /*include_symbols=*/false,
- /*include_inlines=*/true, sc_list_funcs);
+ module_list.FindFunctions(name, eFunctionNameTypeAuto, function_options,
+ sc_list_funcs);
size_t num_matches = sc_list_funcs.GetSize();
if (!num_matches) {
@@ -874,12 +877,13 @@ protected:
void FindMatchingFunctions(Target *target, ConstString name,
SymbolContextList &sc_list) {
// Displaying the source for a symbol:
- bool include_inlines = true;
- bool include_symbols = false;
-
if (m_options.num_lines == 0)
m_options.num_lines = 10;
+ ModuleFunctionSearchOptions function_options;
+ function_options.include_symbols = true;
+ function_options.include_inlines = false;
+
const size_t num_modules = m_options.modules.size();
if (num_modules > 0) {
ModuleList matching_modules;
@@ -889,15 +893,14 @@ protected:
ModuleSpec module_spec(module_file_spec);
matching_modules.Clear();
target->GetImages().FindModules(module_spec, matching_modules);
+
matching_modules.FindFunctions(name, eFunctionNameTypeAuto,
- include_symbols, include_inlines,
- sc_list);
+ function_options, sc_list);
}
}
} else {
target->GetImages().FindFunctions(name, eFunctionNameTypeAuto,
- include_symbols, include_inlines,
- sc_list);
+ function_options, sc_list);
}
}
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index b25514b..ccac874 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -1570,20 +1570,18 @@ static void DumpSymbolContextList(ExecutionContextScope *exe_scope,
static size_t LookupFunctionInModule(CommandInterpreter &interpreter,
Stream &strm, Module *module,
const char *name, bool name_is_regex,
- bool include_inlines, bool include_symbols,
+ const ModuleFunctionSearchOptions &options,
bool verbose) {
if (module && name && name[0]) {
SymbolContextList sc_list;
size_t num_matches = 0;
if (name_is_regex) {
RegularExpression function_name_regex((llvm::StringRef(name)));
- module->FindFunctions(function_name_regex, include_symbols,
- include_inlines, sc_list);
+ module->FindFunctions(function_name_regex, options, sc_list);
} else {
ConstString function_name(name);
module->FindFunctions(function_name, CompilerDeclContext(),
- eFunctionNameTypeAuto, include_symbols,
- include_inlines, sc_list);
+ eFunctionNameTypeAuto, options, sc_list);
}
num_matches = sc_list.GetSize();
if (num_matches) {
@@ -3281,8 +3279,11 @@ protected:
if (m_options.m_type == eLookupTypeFunctionOrSymbol) {
ConstString function_name(m_options.m_str.c_str());
+ ModuleFunctionSearchOptions function_options;
+ function_options.include_symbols = true;
+ function_options.include_inlines = false;
target->GetImages().FindFunctions(function_name, eFunctionNameTypeAuto,
- true, false, sc_list);
+ function_options, sc_list);
} else if (m_options.m_type == eLookupTypeAddress && target) {
Address addr;
if (target->GetSectionLoadList().ResolveLoadAddress(m_options.m_addr,
@@ -3753,13 +3754,15 @@ public:
case eLookupTypeFunctionOrSymbol:
case eLookupTypeFunction:
if (!m_options.m_str.empty()) {
- if (LookupFunctionInModule(
- m_interpreter, result.GetOutputStream(), module,
- m_options.m_str.c_str(), m_options.m_use_regex,
- m_options.m_include_inlines,
- m_options.m_type ==
- eLookupTypeFunctionOrSymbol, // include symbols
- m_options.m_verbose)) {
+ ModuleFunctionSearchOptions function_options;
+ function_options.include_symbols =
+ m_options.m_type == eLookupTypeFunctionOrSymbol;
+ function_options.include_inlines = m_options.m_include_inlines;
+
+ if (LookupFunctionInModule(m_interpreter, result.GetOutputStream(),
+ module, m_options.m_str.c_str(),
+ m_options.m_use_regex, function_options,
+ m_options.m_verbose)) {
result.SetStatus(eReturnStatusSuccessFinishResult);
return true;
}