Added a 'void' format so that the user can manually
suppress all non-error output from the "expression"
command.
<rdar://problem/11225150>
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@161502 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectExpression.cpp b/source/Commands/CommandObjectExpression.cpp
index 4fecc6b..72cb131 100644
--- a/source/Commands/CommandObjectExpression.cpp
+++ b/source/Commands/CommandObjectExpression.cpp
@@ -335,44 +335,51 @@
}
}
}
-
+
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);
+ 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);
+ 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
{