diff options
author | Sean Callanan <scallanan@apple.com> | 2012-08-08 17:35:10 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2012-08-08 17:35:10 +0000 |
commit | bf154daee6b55aa290c4c8a156cc803e71d7119d (patch) | |
tree | 31c2c36fc4a60357fdebc9ddb818834e9e0eb118 /lldb/source/Commands/CommandObjectExpression.cpp | |
parent | 1c7c8f763769d7d98b8ef7538693f7d99be3cedd (diff) | |
download | bcm5719-llvm-bf154daee6b55aa290c4c8a156cc803e71d7119d.tar.gz bcm5719-llvm-bf154daee6b55aa290c4c8a156cc803e71d7119d.zip |
Added a 'void' format so that the user can manually
suppress all non-error output from the "expression"
command.
<rdar://problem/11225150>
llvm-svn: 161502
Diffstat (limited to 'lldb/source/Commands/CommandObjectExpression.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectExpression.cpp | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 4fecc6b46b3..72cb131aea1 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -335,44 +335,51 @@ CommandObjectExpression::EvaluateExpression } } } - + if (result_valobj_sp) { + Format format = m_format_options.GetFormat(); + if (result_valobj_sp->GetError().Success()) { - Format format = m_format_options.GetFormat(); - if (format != eFormatDefault) - result_valobj_sp->SetFormat (format); - - ValueObject::DumpValueObjectOptions options; - options.SetMaximumPointerDepth(0) - .SetMaximumDepth(UINT32_MAX) - .SetShowLocation(false) - .SetShowTypes(m_command_options.show_types) - .SetUseObjectiveC(m_command_options.print_object) - .SetUseDynamicType(use_dynamic) - .SetScopeChecked(true) - .SetFlatOutput(false) - .SetUseSyntheticValue(true) - .SetIgnoreCap(false) - .SetFormat(format) - .SetSummary() - .SetShowSummary(!m_command_options.print_object); - - ValueObject::DumpValueObject (*(output_stream), - result_valobj_sp.get(), // Variable object to dump - options); - if (result) - result->SetStatus (eReturnStatusSuccessFinishResult); + if (format != eFormatVoid) + { + if (format != eFormatDefault) + result_valobj_sp->SetFormat (format); + + ValueObject::DumpValueObjectOptions options; + options.SetMaximumPointerDepth(0) + .SetMaximumDepth(UINT32_MAX) + .SetShowLocation(false) + .SetShowTypes(m_command_options.show_types) + .SetUseObjectiveC(m_command_options.print_object) + .SetUseDynamicType(use_dynamic) + .SetScopeChecked(true) + .SetFlatOutput(false) + .SetUseSyntheticValue(true) + .SetIgnoreCap(false) + .SetFormat(format) + .SetSummary() + .SetShowSummary(!m_command_options.print_object); + + ValueObject::DumpValueObject (*(output_stream), + result_valobj_sp.get(), // Variable object to dump + options); + if (result) + result->SetStatus (eReturnStatusSuccessFinishResult); + } } else { if (result_valobj_sp->GetError().GetError() == ClangUserExpression::kNoResult) { - error_stream->PutCString("<no result>\n"); - - if (result) - result->SetStatus (eReturnStatusSuccessFinishResult); + if (format != eFormatVoid) + { + error_stream->PutCString("<no result>\n"); + + if (result) + result->SetStatus (eReturnStatusSuccessFinishResult); + } } else { |