diff options
author | Enrico Granata <egranata@apple.com> | 2012-03-28 22:17:37 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2012-03-28 22:17:37 +0000 |
commit | 770eb05aa5347fe59b7e7674094b20f76eeb5625 (patch) | |
tree | cf3f12edf404a064216627ea67529d864ae90ed0 | |
parent | bfee542ccedd364accd6746ff6e04a2bfb29a9ad (diff) | |
download | bcm5719-llvm-770eb05aa5347fe59b7e7674094b20f76eeb5625.tar.gz bcm5719-llvm-770eb05aa5347fe59b7e7674094b20f76eeb5625.zip |
Fixing an issue where saying 'po foo' made both the summary and the description for foo come out. If one is po'ing something they most probably only care about the description - We will not omit the summary
llvm-svn: 153608
3 files changed, 19 insertions, 2 deletions
diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h index 17d03fbbf26..4c8a6af3c93 100644 --- a/lldb/include/lldb/Core/ValueObject.h +++ b/lldb/include/lldb/Core/ValueObject.h @@ -309,6 +309,16 @@ public: m_use_objc = use; return *this; } + + DumpValueObjectOptions& + SetShowSummary(bool show = true) + { + if (show == false) + SetOmitSummaryDepth(UINT32_MAX); + else + SetOmitSummaryDepth(0); + return *this; + } DumpValueObjectOptions& SetUseDynamicType(lldb::DynamicValueType dyn = lldb::eNoDynamicValues) diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index f039310212a..33ec52c8a1d 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -364,10 +364,11 @@ CommandObjectExpression::EvaluateExpression .SetScopeChecked(true) .SetFlatOutput(false) .SetUseSyntheticValue(true) - .SetOmitSummaryDepth(0) .SetIgnoreCap(false) .SetFormat(format) - .SetSummary(); + .SetSummary() + .SetShowSummary(!m_command_options.print_object); + ValueObject::DumpValueObject (*(output_stream), result_valobj_sp.get(), // Variable object to dump options); diff --git a/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py b/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py index baeff4c3a9a..b2cc5245b00 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py @@ -358,6 +358,12 @@ class ObjCDataFormatterTestCase(TestBase): self.expect('expr -d true -- @"Hello"', substrs = ['Hello']) + self.expect('expr -d true -o -- @"Hello"', + substrs = ['Hello']) + self.expect('expr -d true -o -- @"Hello"', matching=False, + substrs = ['@"Hello" Hello']) + + def cf_data_formatter_commands(self): """Test formatters for Core OSX frameworks.""" self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) |