diff options
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index da50fe0..71ddc8d 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -803,7 +803,9 @@ public: protected: void DumpGlobalVariableList(const ExecutionContext &exe_ctx, const SymbolContext &sc, - const VariableList &variable_list, Stream &s) { + const VariableList &variable_list, + CommandReturnObject &result) { + Stream &s = result.GetOutputStream(); if (variable_list.Empty()) return; if (sc.module_sp) { @@ -824,15 +826,16 @@ protected: ValueObjectSP valobj_sp(ValueObjectVariable::Create( exe_ctx.GetBestExecutionContextScope(), var_sp)); - if (valobj_sp) + if (valobj_sp) { + result.GetValueObjectList().Append(valobj_sp); DumpValueObject(s, var_sp, valobj_sp, var_sp->GetName().GetCString()); + } } } void DoExecute(Args &args, CommandReturnObject &result) override { Target *target = m_exe_ctx.GetTargetPtr(); const size_t argc = args.GetArgumentCount(); - Stream &s = result.GetOutputStream(); if (argc > 0) { for (const Args::ArgEntry &arg : args) { @@ -874,7 +877,7 @@ protected: m_exe_ctx.GetBestExecutionContextScope(), var_sp); if (valobj_sp) - DumpValueObject(s, var_sp, valobj_sp, + DumpValueObject(result.GetOutputStream(), var_sp, valobj_sp, use_var_name ? var_sp->GetName().GetCString() : arg.c_str()); } @@ -903,7 +906,8 @@ protected: if (comp_unit_varlist_sp) { size_t count = comp_unit_varlist_sp->GetSize(); if (count > 0) { - DumpGlobalVariableList(m_exe_ctx, sc, *comp_unit_varlist_sp, s); + DumpGlobalVariableList(m_exe_ctx, sc, *comp_unit_varlist_sp, + result); success = true; } } @@ -964,7 +968,8 @@ protected: VariableListSP comp_unit_varlist_sp( sc.comp_unit->GetVariableList(can_create)); if (comp_unit_varlist_sp) - DumpGlobalVariableList(m_exe_ctx, sc, *comp_unit_varlist_sp, s); + DumpGlobalVariableList(m_exe_ctx, sc, *comp_unit_varlist_sp, + result); } else if (sc.module_sp) { // Get all global variables for this module lldb_private::RegularExpression all_globals_regex( @@ -972,7 +977,7 @@ protected: VariableList variable_list; sc.module_sp->FindGlobalVariables(all_globals_regex, UINT32_MAX, variable_list); - DumpGlobalVariableList(m_exe_ctx, sc, variable_list, s); + DumpGlobalVariableList(m_exe_ctx, sc, variable_list, result); } } } |