summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-10-06 03:09:11 +0000
committerGreg Clayton <gclayton@apple.com>2010-10-06 03:09:11 +0000
commit32c4085ba2d259ff9a4365b1962362248de2c655 (patch)
tree33daf492f6ff65a408bdbddea830dd789735b6d7 /lldb/source
parent0f7e94fd7b7d877359cfeeb9d9d9ca52f2577233 (diff)
downloadbcm5719-llvm-32c4085ba2d259ff9a4365b1962362248de2c655.tar.gz
bcm5719-llvm-32c4085ba2d259ff9a4365b1962362248de2c655.zip
Restored the ability to set the format for expressions after changing the expression results over to ValueObjectSP objects.
llvm-svn: 115733
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp3
-rw-r--r--lldb/source/Core/ValueObject.cpp24
2 files changed, 17 insertions, 10 deletions
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