summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/Core/ValueObject.h13
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp3
-rw-r--r--lldb/source/Core/ValueObject.cpp24
3 files changed, 30 insertions, 10 deletions
diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h
index 2d1b43a0a6f..0e6385f7d40 100644
--- a/lldb/include/lldb/Core/ValueObject.h
+++ b/lldb/include/lldb/Core/ValueObject.h
@@ -213,6 +213,18 @@ public:
m_update_id = LLDB_INVALID_UID;
}
+ lldb::Format
+ GetFormat () const
+ {
+ return m_format;
+ }
+
+ void
+ SetFormat (lldb::Format format)
+ {
+ m_format = format;
+ }
+
protected:
//------------------------------------------------------------------
// Classes that inherit from ValueObject can see and modify these
@@ -236,6 +248,7 @@ protected:
std::vector<lldb::ValueObjectSP> m_children;
std::map<ConstString, lldb::ValueObjectSP> m_synthetic_children;
lldb::ValueObjectSP m_dynamic_value_sp;
+ lldb::Format m_format;
bool m_value_is_valid:1,
m_value_did_change:1,
m_children_count_valid:1,
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index 1f6c3de1903..516d941867d 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -237,6 +237,9 @@ CommandObjectExpression::EvaluateExpression
assert (result_valobj_sp.get());
if (result_valobj_sp->GetError().Success())
{
+ if (m_options.format != eFormatDefault)
+ result_valobj_sp->SetFormat (m_options.format);
+
ValueObject::DumpValueObject (output_stream,
m_exe_ctx.GetBestExecutionContextScope(),
result_valobj_sp.get(), // Variable object to dump
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index cc7f40887b8..bd613ba7b2c 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -56,6 +56,8 @@ ValueObject::ValueObject () :
m_object_desc_str (),
m_children (),
m_synthetic_children (),
+ m_dynamic_value_sp (),
+ m_format (eFormatDefault),
m_value_is_valid (false),
m_value_did_change (false),
m_children_count_valid (false),
@@ -584,16 +586,18 @@ ValueObject::GetValueAsCString (ExecutionContextScope *exe_scope)
if (clang_type)
{
StreamString sstr;
- lldb::Format format = ClangASTType::GetFormat(clang_type);
- if (ClangASTType::DumpTypeValue(GetClangAST(), // The clang AST
- clang_type, // The clang type to display
- &sstr,
- format, // Format to display this type with
- m_data, // Data to extract from
- 0, // Byte offset into "m_data"
- GetByteSize(), // Byte size of item in "m_data"
- GetBitfieldBitSize(), // Bitfield bit size
- GetBitfieldBitOffset())) // Bitfield bit offset
+ if (m_format == eFormatDefault)
+ m_format = ClangASTType::GetFormat(clang_type);
+
+ if (ClangASTType::DumpTypeValue (GetClangAST(), // The clang AST
+ clang_type, // The clang type to display
+ &sstr,
+ m_format, // Format to display this type with
+ m_data, // Data to extract from
+ 0, // Byte offset into "m_data"
+ GetByteSize(), // Byte size of item in "m_data"
+ GetBitfieldBitSize(), // Bitfield bit size
+ GetBitfieldBitOffset())) // Bitfield bit offset
m_value_str.swap(sstr.GetString());
else
m_value_str.clear();
OpenPOWER on IntegriCloud