diff options
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandObjectDWIMPrint.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectExpression.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectFrame.cpp | 16 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 19 |
4 files changed, 29 insertions, 11 deletions
diff --git a/lldb/source/Commands/CommandObjectDWIMPrint.cpp b/lldb/source/Commands/CommandObjectDWIMPrint.cpp index d4d038d..0414242 100644 --- a/lldb/source/Commands/CommandObjectDWIMPrint.cpp +++ b/lldb/source/Commands/CommandObjectDWIMPrint.cpp @@ -205,6 +205,9 @@ void CommandObjectDWIMPrint::DoExecute(StringRef command, ExpressionResults expr_result = target.EvaluateExpression( expr, exe_scope, valobj_sp, eval_options, &fixed_expression); + if (valobj_sp) + result.GetValueObjectList().Append(valobj_sp); + // Record the position of the expression in the command. std::optional<uint16_t> indent; if (fixed_expression.empty()) { diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 7e26381..18526c4 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -434,6 +434,8 @@ bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr, } if (result_valobj_sp) { + result.GetValueObjectList().Append(result_valobj_sp); + Format format = m_format_options.GetFormat(); if (result_valobj_sp->GetError().Success()) { diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index a5709b3..7e42ef2 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -152,6 +152,7 @@ protected: return; } + result.GetValueObjectList().Append(valobj_sp); DumpValueObjectOptions::DeclPrintingHelper helper = [&valobj_sp](ConstString type, ConstString var, const DumpValueObjectOptions &opts, @@ -317,10 +318,10 @@ protected: } else if (*m_options.relative_frame_offset > 0) { // I don't want "up 20" where "20" takes you past the top of the stack // to produce an error, but rather to just go to the top. OTOH, start - // by seeing if the requested frame exists, in which case we can avoid + // by seeing if the requested frame exists, in which case we can avoid // counting the stack here... - const uint32_t frame_requested = frame_idx - + *m_options.relative_frame_offset; + const uint32_t frame_requested = + frame_idx + *m_options.relative_frame_offset; StackFrameSP frame_sp = thread->GetStackFrameAtIndex(frame_requested); if (frame_sp) frame_idx = frame_requested; @@ -515,8 +516,8 @@ protected: if (error.Fail() && (!variable_list || variable_list->GetSize() == 0)) { result.AppendError(error.AsCString()); - } + ValueObjectSP valobj_sp; TypeSummaryImplSP summary_format_sp; @@ -564,6 +565,8 @@ protected: valobj_sp = frame->GetValueObjectForFrameVariable( var_sp, m_varobj_options.use_dynamic); if (valobj_sp) { + result.GetValueObjectList().Append(valobj_sp); + std::string scope_string; if (m_option_variable.show_scope) scope_string = GetScopeString(var_sp).str(); @@ -604,6 +607,8 @@ protected: entry.ref(), m_varobj_options.use_dynamic, expr_path_options, var_sp, error); if (valobj_sp) { + result.GetValueObjectList().Append(valobj_sp); + std::string scope_string; if (m_option_variable.show_scope) scope_string = GetScopeString(var_sp).str(); @@ -653,6 +658,8 @@ protected: valobj_sp = frame->GetValueObjectForFrameVariable( var_sp, m_varobj_options.use_dynamic); if (valobj_sp) { + result.GetValueObjectList().Append(valobj_sp); + // When dumping all variables, don't print any variables that are // not in scope to avoid extra unneeded output if (valobj_sp->IsInScope()) { @@ -694,6 +701,7 @@ protected: recognized_frame->GetRecognizedArguments(); if (recognized_arg_list) { for (auto &rec_value_sp : recognized_arg_list->GetObjects()) { + result.GetValueObjectList().Append(rec_value_sp); options.SetFormat(m_option_format.GetFormat()); options.SetVariableFormatDisplayLanguage( rec_value_sp->GetPreferredDisplayLanguage()); 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); } } } |