summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp65
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp1
2 files changed, 37 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
{
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 1760c1dc6c8..71522308389 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -1108,6 +1108,7 @@ protected:
case eFormatAddressInfo:
case eFormatHexFloat:
case eFormatInstruction:
+ case eFormatVoid:
result.AppendError("unsupported format for writing memory");
result.SetStatus(eReturnStatusFailed);
return false;
OpenPOWER on IntegriCloud