summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters/ValueObjectPrinter.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2015-06-03 20:43:54 +0000
committerEnrico Granata <egranata@apple.com>2015-06-03 20:43:54 +0000
commitd5957336178074b29ad5105ad76611e5187b636d (patch)
tree69888cd8e345e168c9c0f1a98c763231dc26cc9a /lldb/source/DataFormatters/ValueObjectPrinter.cpp
parent4bcc13d98812d97a9e8e75c494b73587d64ee044 (diff)
downloadbcm5719-llvm-d5957336178074b29ad5105ad76611e5187b636d.tar.gz
bcm5719-llvm-d5957336178074b29ad5105ad76611e5187b636d.zip
Fix a bug where trying to Dump() a ValueObject would use the static/non-synthetic version of the value even if the ValueObject one actually called Dump() on turned out to be dynamic and/or synthetic
This was of course overridable by using DumpValueObjectOptions, but the default should be saner and the previous behavior made for a few fun investigations.... rdar://problem/21065149 llvm-svn: 238961
Diffstat (limited to 'lldb/source/DataFormatters/ValueObjectPrinter.cpp')
-rw-r--r--lldb/source/DataFormatters/ValueObjectPrinter.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
index 8fd627020bc..7c794ee2dda 100644
--- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp
+++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
@@ -21,6 +21,28 @@
using namespace lldb;
using namespace lldb_private;
+DumpValueObjectOptions::DumpValueObjectOptions (ValueObject& valobj) :
+DumpValueObjectOptions()
+{
+ m_use_dynamic = valobj.GetDynamicValueType();
+ m_use_synthetic = valobj.IsSynthetic();
+}
+
+ValueObjectPrinter::ValueObjectPrinter (ValueObject* valobj,
+ Stream* s)
+{
+ if (valobj)
+ {
+ DumpValueObjectOptions options(*valobj);
+ Init (valobj,s,options,options.m_max_ptr_depth,0);
+ }
+ else
+ {
+ DumpValueObjectOptions options;
+ Init (valobj,s,options,options.m_max_ptr_depth,0);
+ }
+}
+
ValueObjectPrinter::ValueObjectPrinter (ValueObject* valobj,
Stream* s,
const DumpValueObjectOptions& options)
OpenPOWER on IntegriCloud