summaryrefslogtreecommitdiff
path: root/lldb/source/API/SBModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/API/SBModule.cpp')
-rw-r--r--lldb/source/API/SBModule.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index 6cc6d2628ace..4e9dfb0c1e62 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -245,7 +245,7 @@ bool SBModule::GetDescription(SBStream &description) {
ModuleSP module_sp(GetSP());
if (module_sp) {
- module_sp->GetDescription(&strm);
+ module_sp->GetDescription(strm.AsRawOstream());
} else
strm.PutCString("No value");
@@ -419,16 +419,12 @@ SBValueList SBModule::FindGlobalVariables(SBTarget &target, const char *name,
VariableList variable_list;
module_sp->FindGlobalVariables(ConstString(name), nullptr, max_matches,
variable_list);
- const uint32_t match_count = variable_list.GetSize();
- if (match_count > 0) {
- for (uint32_t i = 0; i < match_count; ++i) {
- lldb::ValueObjectSP valobj_sp;
- TargetSP target_sp(target.GetSP());
- valobj_sp = ValueObjectVariable::Create(
- target_sp.get(), variable_list.GetVariableAtIndex(i));
- if (valobj_sp)
- sb_value_list.Append(SBValue(valobj_sp));
- }
+ for (const VariableSP &var_sp : variable_list) {
+ lldb::ValueObjectSP valobj_sp;
+ TargetSP target_sp(target.GetSP());
+ valobj_sp = ValueObjectVariable::Create(target_sp.get(), var_sp);
+ if (valobj_sp)
+ sb_value_list.Append(SBValue(valobj_sp));
}
}