summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBTarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/API/SBTarget.cpp')
-rw-r--r--lldb/source/API/SBTarget.cpp45
1 files changed, 19 insertions, 26 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 0d0a470e202..1d13087eef6 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -1653,11 +1653,8 @@ SBSymbolContextList SBTarget::FindCompileUnits(const SBFileSpec &sb_file_spec) {
SBSymbolContextList sb_sc_list;
const TargetSP target_sp(GetSP());
- if (target_sp && sb_file_spec.IsValid()) {
- const bool append = true;
- target_sp->GetImages().FindCompileUnits(*sb_file_spec,
- append, *sb_sc_list);
- }
+ if (target_sp && sb_file_spec.IsValid())
+ target_sp->GetImages().FindCompileUnits(*sb_file_spec, *sb_sc_list);
return LLDB_RECORD_RESULT(sb_sc_list);
}
@@ -1783,10 +1780,9 @@ lldb::SBSymbolContextList SBTarget::FindFunctions(const char *name,
const bool symbols_ok = true;
const bool inlines_ok = true;
- const bool append = true;
FunctionNameType mask = static_cast<FunctionNameType>(name_type_mask);
target_sp->GetImages().FindFunctions(ConstString(name), mask, symbols_ok,
- inlines_ok, append, *sb_sc_list);
+ inlines_ok, *sb_sc_list);
return LLDB_RECORD_RESULT(sb_sc_list);
}
@@ -1806,17 +1802,16 @@ lldb::SBSymbolContextList SBTarget::FindGlobalFunctions(const char *name,
switch (matchtype) {
case eMatchTypeRegex:
target_sp->GetImages().FindFunctions(RegularExpression(name_ref), true,
- true, true, *sb_sc_list);
+ true, *sb_sc_list);
break;
case eMatchTypeStartsWith:
regexstr = llvm::Regex::escape(name) + ".*";
target_sp->GetImages().FindFunctions(RegularExpression(regexstr), true,
- true, true, *sb_sc_list);
+ true, *sb_sc_list);
break;
default:
- target_sp->GetImages().FindFunctions(ConstString(name),
- eFunctionNameTypeAny, true, true,
- true, *sb_sc_list);
+ target_sp->GetImages().FindFunctions(
+ ConstString(name), eFunctionNameTypeAny, true, true, *sb_sc_list);
break;
}
}
@@ -1933,9 +1928,9 @@ SBValueList SBTarget::FindGlobalVariables(const char *name,
TargetSP target_sp(GetSP());
if (name && target_sp) {
VariableList variable_list;
- const uint32_t match_count = target_sp->GetImages().FindGlobalVariables(
- ConstString(name), max_matches, variable_list);
-
+ target_sp->GetImages().FindGlobalVariables(ConstString(name), max_matches,
+ variable_list);
+ const uint32_t match_count = variable_list.GetSize();
if (match_count > 0) {
ExecutionContextScope *exe_scope = target_sp->GetProcessSP().get();
if (exe_scope == nullptr)
@@ -1970,20 +1965,20 @@ SBValueList SBTarget::FindGlobalVariables(const char *name,
uint32_t match_count;
switch (matchtype) {
case eMatchTypeNormal:
- match_count = target_sp->GetImages().FindGlobalVariables(
- ConstString(name), max_matches, variable_list);
+ target_sp->GetImages().FindGlobalVariables(ConstString(name), max_matches,
+ variable_list);
break;
case eMatchTypeRegex:
- match_count = target_sp->GetImages().FindGlobalVariables(
- RegularExpression(name_ref), max_matches, variable_list);
+ target_sp->GetImages().FindGlobalVariables(RegularExpression(name_ref),
+ max_matches, variable_list);
break;
case eMatchTypeStartsWith:
regexstr = llvm::Regex::escape(name) + ".*";
- match_count = target_sp->GetImages().FindGlobalVariables(
- RegularExpression(regexstr), max_matches, variable_list);
+ target_sp->GetImages().FindGlobalVariables(RegularExpression(regexstr),
+ max_matches, variable_list);
break;
}
-
+ match_count = variable_list.GetSize();
if (match_count > 0) {
ExecutionContextScope *exe_scope = target_sp->GetProcessSP().get();
if (exe_scope == nullptr)
@@ -2287,11 +2282,9 @@ lldb::SBSymbolContextList SBTarget::FindSymbols(const char *name,
SBSymbolContextList sb_sc_list;
if (name && name[0]) {
TargetSP target_sp(GetSP());
- if (target_sp) {
- bool append = true;
+ if (target_sp)
target_sp->GetImages().FindSymbolsWithNameAndType(
- ConstString(name), symbol_type, *sb_sc_list, append);
- }
+ ConstString(name), symbol_type, *sb_sc_list);
}
return LLDB_RECORD_RESULT(sb_sc_list);
}
OpenPOWER on IntegriCloud