summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/lldb-enumerations.h1
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp65
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp1
-rw-r--r--lldb/source/Core/FormatManager.cpp3
-rw-r--r--lldb/source/Target/Process.cpp2
5 files changed, 41 insertions, 31 deletions
diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h
index c2ef7ccf5b3..0ed17c69c77 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -124,6 +124,7 @@ namespace lldb {
eFormatAddressInfo, // Describe what an address points to (func + offset with file/line, symbol + offset, data, etc)
eFormatHexFloat, // ISO C99 hex float string
eFormatInstruction, // Disassemble an opcode
+ eFormatVoid, // Do not print this
kNumFormats
} Format;
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;
diff --git a/lldb/source/Core/FormatManager.cpp b/lldb/source/Core/FormatManager.cpp
index c49301818c0..f9509cb01e7 100644
--- a/lldb/source/Core/FormatManager.cpp
+++ b/lldb/source/Core/FormatManager.cpp
@@ -65,7 +65,8 @@ g_format_infos[] =
{ eFormatCharArray , 'a' , "character array" },
{ eFormatAddressInfo , 'A' , "address" },
{ eFormatHexFloat , 'X' , "hex float" },
- { eFormatInstruction , 'i' , "instruction" }
+ { eFormatInstruction , 'i' , "instruction" },
+ { eFormatVoid , 'v' , "void" }
};
static uint32_t
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 993d9809250..03f40f0f8c7 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -4319,7 +4319,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx,
if (stop_state == eStateExited)
event_to_broadcast_sp = event_sp;
- errors.Printf ("Execution stopped with unexpected state.");
+ errors.Printf ("Execution stopped with unexpected state.\n");
return_value = eExecutionInterrupted;
break;
}
OpenPOWER on IntegriCloud