diff options
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) |