diff options
19 files changed, 188 insertions, 92 deletions
diff --git a/lldb/include/lldb/DataFormatters/DataVisualization.h b/lldb/include/lldb/DataFormatters/DataVisualization.h index 499e0fe14d9..b39465944f5 100644 --- a/lldb/include/lldb/DataFormatters/DataVisualization.h +++ b/lldb/include/lldb/DataFormatters/DataVisualization.h @@ -36,6 +36,9 @@ public: static uint32_t GetCurrentRevision (); + static bool + ShouldPrintAsOneLiner (ValueObject& valobj); + class ValueFormats { public: diff --git a/lldb/include/lldb/DataFormatters/FormatManager.h b/lldb/include/lldb/DataFormatters/FormatManager.h index 09904a6e1f2..458a7e9a639 100644 --- a/lldb/include/lldb/DataFormatters/FormatManager.h +++ b/lldb/include/lldb/DataFormatters/FormatManager.h @@ -190,6 +190,13 @@ public: static lldb::Format GetSingleItemFormat (lldb::Format vector_format); + // this returns true if the ValueObjectPrinter is *highly encouraged* + // to actually represent this ValueObject in one-liner format + // If this object has a summary formatter, however, we should not + // try and do one-lining, just let the summary do the right thing + bool + ShouldPrintAsOneLiner (ValueObject& valobj); + void Changed () { diff --git a/lldb/include/lldb/DataFormatters/TypeSummary.h b/lldb/include/lldb/DataFormatters/TypeSummary.h index 7b3c81a1098..1c195ab2ba4 100644 --- a/lldb/include/lldb/DataFormatters/TypeSummary.h +++ b/lldb/include/lldb/DataFormatters/TypeSummary.h @@ -238,7 +238,7 @@ namespace lldb_private { } bool - IsOneliner () const + IsOneLiner () const { return m_flags.GetShowMembersOneLiner(); } @@ -280,7 +280,7 @@ namespace lldb_private { } void - SetIsOneliner (bool value) + SetIsOneLiner (bool value) { m_flags.SetShowMembersOneLiner(value); } diff --git a/lldb/include/lldb/DataFormatters/ValueObjectPrinter.h b/lldb/include/lldb/DataFormatters/ValueObjectPrinter.h index 7b149a51c17..b0674038416 100644 --- a/lldb/include/lldb/DataFormatters/ValueObjectPrinter.h +++ b/lldb/include/lldb/DataFormatters/ValueObjectPrinter.h @@ -260,6 +260,9 @@ public: bool PrintValueObject (); + bool + PrintChildrenOneLiner (bool hide_names); + protected: // only this class (and subclasses, if any) should ever be concerned with diff --git a/lldb/source/DataFormatters/DataVisualization.cpp b/lldb/source/DataFormatters/DataVisualization.cpp index c1ef359049b..94447fc8ede 100644 --- a/lldb/source/DataFormatters/DataVisualization.cpp +++ b/lldb/source/DataFormatters/DataVisualization.cpp @@ -40,6 +40,12 @@ DataVisualization::GetCurrentRevision () return GetFormatManager().GetCurrentRevision(); } +bool +DataVisualization::ShouldPrintAsOneLiner (ValueObject& valobj) +{ + return GetFormatManager().ShouldPrintAsOneLiner(valobj); +} + lldb::TypeFormatImplSP DataVisualization::ValueFormats::GetFormat (ValueObject& valobj, lldb::DynamicValueType use_dynamic) { diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp index c4debf9c259..415ecc23dde 100644 --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -305,6 +305,66 @@ FormatManager::GetSingleItemFormat(lldb::Format vector_format) } } +bool +FormatManager::ShouldPrintAsOneLiner (ValueObject& valobj) +{ + // if this object has a summary, don't try to do anything special to it + // if the user wants one-liner, they can ask for it in summary :) + if (valobj.GetSummaryFormat().get() != nullptr) + return false; + + // no children, no party + if (valobj.GetNumChildren() == 0) + return false; + + size_t total_children_name_len = 0; + + for (size_t idx = 0; + idx < valobj.GetNumChildren(); + idx++) + { + ValueObjectSP child_sp(valobj.GetChildAtIndex(idx, true)); + // something is wrong here - bail out + if (!child_sp) + return false; + // if we decided to define synthetic children for a type, we probably care enough + // to show them, but avoid nesting children in children + if (child_sp->GetSyntheticChildren().get() != nullptr) + return false; + + total_children_name_len += child_sp->GetName().GetLength(); + + // 50 itself is a "randomly" chosen number - the idea is that + // overly long structs should not get this treatment + // FIXME: maybe make this a user-tweakable setting? + if (total_children_name_len > 50) + return false; + + // if a summary is there.. + if (child_sp->GetSummaryFormat()) + { + // and it wants children, then bail out + if (child_sp->GetSummaryFormat()->DoesPrintChildren()) + return false; + } + + // if there is a base-class... + if (child_sp->IsBaseClass()) + { + // and it has children.. + if (child_sp->GetNumChildren()) + { + // ...and no summary... + // (if it had a summary and the summary wanted children, we would have bailed out anyway + // so this only makes us bail out if this has no summary and we would then print children) + if (!child_sp->GetSummaryFormat()) + return false; // then bail out + } + } + } + return true; +} + ConstString FormatManager::GetValidTypeName (const ConstString& type) { diff --git a/lldb/source/DataFormatters/TypeSummary.cpp b/lldb/source/DataFormatters/TypeSummary.cpp index 8c4d3f71c05..4c75b4b87d0 100644 --- a/lldb/source/DataFormatters/TypeSummary.cpp +++ b/lldb/source/DataFormatters/TypeSummary.cpp @@ -23,6 +23,7 @@ #include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/DataFormatters/TypeSummary.h" +#include "lldb/DataFormatters/ValueObjectPrinter.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Symbol/ClangASTType.h" #include "lldb/Target/StackFrame.h" @@ -65,51 +66,12 @@ StringSummaryFormat::FormatObject (ValueObject *valobj, if (frame) sc = frame->GetSymbolContext(lldb::eSymbolContextEverything); - if (IsOneliner()) + if (IsOneLiner()) { - ValueObject* object; - - ValueObjectSP synth_valobj = valobj->GetSyntheticValue(); - if (synth_valobj) - object = synth_valobj.get(); - else - object = valobj; - - const uint32_t num_children = object->GetNumChildren(); - if (num_children) - { - s.PutChar('('); - - for (uint32_t idx=0; idx<num_children; ++idx) - { - lldb::ValueObjectSP child_sp(object->GetChildAtIndex(idx, true)); - if (child_sp.get()) - { - if (idx) - s.PutCString(", "); - if (!HideNames()) - { - s.PutCString(child_sp.get()->GetName().AsCString()); - s.PutCString(" = "); - } - child_sp.get()->DumpPrintableRepresentation(s, - ValueObject::eValueObjectRepresentationStyleSummary, - lldb::eFormatInvalid, - ValueObject::ePrintableRepresentationSpecialCasesDisable); - } - } - - s.PutChar(')'); - - retval.assign(s.GetString()); - return true; - } - else - { - retval.assign("error: oneliner for no children"); - return false; - } - + ValueObjectPrinter printer(valobj,&s,DumpValueObjectOptions()); + printer.PrintChildrenOneLiner(HideNames()); + retval.assign(s.GetData()); + return true; } else { @@ -135,7 +97,7 @@ StringSummaryFormat::GetDescription () Cascades() ? "" : " (not cascading)", !DoesPrintChildren() ? "" : " (show children)", !DoesPrintValue() ? " (hide value)" : "", - IsOneliner() ? " (one-line printout)" : "", + IsOneLiner() ? " (one-line printout)" : "", SkipsPointers() ? " (skip pointers)" : "", SkipsReferences() ? " (skip references)" : "", HideNames() ? " (hide member names)" : ""); @@ -171,7 +133,7 @@ CXXFunctionSummaryFormat::GetDescription () Cascades() ? "" : " (not cascading)", !DoesPrintChildren() ? "" : " (show children)", !DoesPrintValue() ? " (hide value)" : "", - IsOneliner() ? " (one-line printout)" : "", + IsOneLiner() ? " (one-line printout)" : "", SkipsPointers() ? " (skip pointers)" : "", SkipsReferences() ? " (skip references)" : "", HideNames() ? " (hide member names)" : ""); @@ -238,7 +200,7 @@ ScriptSummaryFormat::GetDescription () sstr.Printf ("%s%s%s%s%s%s%s\n%s", Cascades() ? "" : " (not cascading)", !DoesPrintChildren() ? "" : " (show children)", !DoesPrintValue() ? " (hide value)" : "", - IsOneliner() ? " (one-line printout)" : "", + IsOneLiner() ? " (one-line printout)" : "", SkipsPointers() ? " (skip pointers)" : "", SkipsReferences() ? " (skip references)" : "", HideNames() ? " (hide member names)" : "", diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp index cd316cec628..7da5450bcd2 100644 --- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp +++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp @@ -14,6 +14,7 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/Debugger.h" +#include "lldb/DataFormatters/DataVisualization.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Target/Target.h" @@ -97,6 +98,8 @@ ValueObjectPrinter::PrintValueObject () bool ValueObjectPrinter::GetDynamicValueIfNeeded () { + if (m_valobj) + return true; bool update_success = m_orig_valobj->UpdateValueIfNeeded (true); if (!update_success) return false; @@ -522,6 +525,55 @@ ValueObjectPrinter::PrintChildren (uint32_t curr_ptr_depth) } } +bool +ValueObjectPrinter::PrintChildrenOneLiner (bool hide_names) +{ + if (!GetDynamicValueIfNeeded () || m_valobj == nullptr) + return false; + + ValueObject* synth_m_valobj = GetValueObjectForChildrenGeneration(); + + bool print_dotdotdot = false; + size_t num_children = GetMaxNumChildrenToPrint(print_dotdotdot); + + if (num_children) + { + m_stream->PutChar('('); + + for (uint32_t idx=0; idx<num_children; ++idx) + { + lldb::ValueObjectSP child_sp(synth_m_valobj->GetChildAtIndex(idx, true)); + lldb::ValueObjectSP child_dyn_sp = child_sp.get() ? child_sp->GetDynamicValue(options.m_use_dynamic) : child_sp; + if (child_dyn_sp) + child_sp = child_dyn_sp; + if (child_sp) + { + if (idx) + m_stream->PutCString(", "); + if (!hide_names) + { + const char* name = child_sp.get()->GetName().AsCString(); + if (name && *name) + { + m_stream->PutCString(name); + m_stream->PutCString(" = "); + } + } + child_sp->DumpPrintableRepresentation(*m_stream, + ValueObject::eValueObjectRepresentationStyleSummary, + lldb::eFormatInvalid, + ValueObject::ePrintableRepresentationSpecialCasesDisable); + } + } + + if (print_dotdotdot) + m_stream->PutCString(", ...)"); + else + m_stream->PutChar(')'); + } + return true; +} + void ValueObjectPrinter::PrintChildrenIfNeeded (bool value_printed, bool summary_printed) @@ -532,10 +584,18 @@ ValueObjectPrinter::PrintChildrenIfNeeded (bool value_printed, uint32_t curr_ptr_depth = m_ptr_depth; bool print_children = ShouldPrintChildren (is_failed_description,curr_ptr_depth); + bool print_oneline = (curr_ptr_depth > 0 || options.m_show_types) ? false : DataVisualization::ShouldPrintAsOneLiner(*m_valobj); if (print_children) { - PrintChildren (curr_ptr_depth); + if (print_oneline) + { + m_stream->PutChar(' '); + PrintChildrenOneLiner (false); + m_stream->EOL(); + } + else + PrintChildren (curr_ptr_depth); } else if (m_curr_depth >= options.m_max_depth && IsAggregate() && ShouldPrintValueObject()) { diff --git a/lldb/test/expression_command/persistent_types/TestPersistentTypes.py b/lldb/test/expression_command/persistent_types/TestPersistentTypes.py index ab45d449d35..bf24e9e1285 100644 --- a/lldb/test/expression_command/persistent_types/TestPersistentTypes.py +++ b/lldb/test/expression_command/persistent_types/TestPersistentTypes.py @@ -38,10 +38,10 @@ class PersistenttypesTestCase(TestBase): self.runCmd("next") self.expect("memory read foo -t $foobar", - substrs = ['($foobar) 0x', ' = {', "a = 'H'","b = 'e'","c = 'l'","d = 'l'"]) # persistent types are OK to use for memory read + substrs = ['($foobar) 0x', ' = ', "a = 'H'","b = 'e'","c = 'l'","d = 'l'"]) # persistent types are OK to use for memory read self.expect("memory read foo -t foobar", - substrs = ['($foobar) 0x', ' = {', "a = 'H'","b = 'e'","c = 'l'","d = 'l'"],matching=False,error=True) # the type name is $foobar, make sure we settle for nothing less + substrs = ['($foobar) 0x', ' = ', "a = 'H'","b = 'e'","c = 'l'","d = 'l'"],matching=False,error=True) # the type name is $foobar, make sure we settle for nothing less if __name__ == '__main__': diff --git a/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py b/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py index 01e738adddb..935673cb7ad 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py @@ -178,7 +178,7 @@ class AdvDataFormatterTestCase(TestBase): # if the summary has an error, we still display the value self.expect("frame variable couple --summary-string \"${*var.sp.foo[0-2]\"", - substrs = ['(Couple) couple = {','sp = {','z =','"X"']) + substrs = ['(Couple) couple = (sp = SimpleWithPointers @ 0x', 's = 0x',')']) self.runCmd("type summary add --summary-string \"${*var.sp.x[0-2]} are low bits of integer ${*var.sp.x}. If I pretend it is an array I get ${var.sp.x[0-5]}\" Couple") diff --git a/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py b/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py index 29ab2e9671e..389a5e06e60 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py @@ -292,7 +292,7 @@ class CategoriesDataFormatterTestCase(TestBase): self.expect("frame variable c1 r1 c_ptr r_ptr", substrs = ['ACircle', - '(Rectangle) r1 = {', 'w = 5', 'h = 6', + '(Rectangle) r1 = ', 'w = 5', 'h = 6', 'ACircle', 'ARectangleStar']) 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 2d5f2965f02..a093b8844d8 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py @@ -297,7 +297,7 @@ class ObjCDataFormatterTestCase(TestBase): self.runCmd("type summary add --summary-string \"a test\" MyClass") self.expect("frame variable *object2", - substrs = ['*object2 = {', + substrs = ['*object2 =', 'MyClass = a test', 'backup = ']); diff --git a/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py b/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py index baf3f2d244b..2c203f647ec 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py @@ -158,9 +158,7 @@ class SkipSummaryDataFormatterTestCase(TestBase): self.expect('frame variable data1.m_child1->m_child2.m_child1.m_child2 --no-summary-depth=2', substrs = ['(DeepData_5) data1.m_child1->m_child2.m_child1.m_child2 = {', 'm_some_text = {', - '_M_dataplus = {', - '_M_p = 0x', - '"Just a test"']) + '_M_dataplus = (_M_p = "Just a test")']) # Repeat the above, but only skip 1 level of summaries self.expect('frame variable data1.m_child1->m_child2.m_child1.m_child2 --no-summary-depth=1', diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py index ce5f0f2b690..a4668b5cfac 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py @@ -68,10 +68,10 @@ class LibcxxMapDataFormatterTestCase(TestBase): self.expect('frame variable ii', substrs = ['size=2', - '[0] = {', + '[0] = ', 'first = 0', 'second = 0', - '[1] = {', + '[1] = ', 'first = 1', 'second = 1']) @@ -79,10 +79,10 @@ class LibcxxMapDataFormatterTestCase(TestBase): self.expect('frame variable ii', substrs = ['size=4', - '[2] = {', + '[2] = ', 'first = 2', 'second = 0', - '[3] = {', + '[3] = ', 'first = 3', 'second = 1']) @@ -90,19 +90,19 @@ class LibcxxMapDataFormatterTestCase(TestBase): self.expect("frame variable ii", substrs = ['size=8', - '[5] = {', + '[5] = ', 'first = 5', 'second = 0', - '[7] = {', + '[7] = ', 'first = 7', 'second = 1']) self.expect("p ii", substrs = ['size=8', - '[5] = {', + '[5] = ', 'first = 5', 'second = 0', - '[7] = {', + '[7] = ', 'first = 7', 'second = 1']) diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py index ec450e1b024..6e75fc20501 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py @@ -67,10 +67,10 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase): self.expect('frame variable ii', substrs = ['size=2', - '[0] = {', + '[0] = ', 'first = 0', 'second = 0', - '[1] = {', + '[1] = ', 'first = 1', 'second = 1']) @@ -78,10 +78,10 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase): self.expect('frame variable ii', substrs = ['size=4', - '[2] = {', + '[2] = ', 'first = 2', 'second = 0', - '[3] = {', + '[3] = ', 'first = 3', 'second = 1']) @@ -89,19 +89,19 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase): self.expect("frame variable ii", substrs = ['size=8', - '[5] = {', + '[5] = ', 'first = 5', 'second = 0', - '[7] = {', + '[7] = ', 'first = 7', 'second = 1']) self.expect("p ii", substrs = ['size=8', - '[5] = {', + '[5] = ', 'first = 5', 'second = 0', - '[7] = {', + '[7] = ', 'first = 7', 'second = 1']) diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py index e64e9b7cf04..1b0cc815802 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py @@ -74,10 +74,10 @@ class StdMapDataFormatterTestCase(TestBase): self.expect('frame variable ii', substrs = ['map has 2 items', - '[0] = {', + '[0] = ', 'first = 0', 'second = 0', - '[1] = {', + '[1] = ', 'first = 1', 'second = 1']) @@ -85,10 +85,10 @@ class StdMapDataFormatterTestCase(TestBase): self.expect('frame variable ii', substrs = ['map has 4 items', - '[2] = {', + '[2] = ', 'first = 2', 'second = 0', - '[3] = {', + '[3] = ', 'first = 3', 'second = 1']) @@ -96,19 +96,19 @@ class StdMapDataFormatterTestCase(TestBase): self.expect("frame variable ii", substrs = ['map has 9 items', - '[5] = {', + '[5] = ', 'first = 5', 'second = 0', - '[7] = {', + '[7] = ', 'first = 7', 'second = 1']) self.expect("p ii", substrs = ['map has 9 items', - '[5] = {', + '[5] = ', 'first = 5', 'second = 0', - '[7] = {', + '[7] = ', 'first = 7', 'second = 1']) diff --git a/lldb/test/functionalities/data-formatter/rdar-11988289/TestRdar 11988289.py b/lldb/test/functionalities/data-formatter/rdar-11988289/TestRdar 11988289.py index 0a85da7b529..38226ca14da 100644 --- a/lldb/test/functionalities/data-formatter/rdar-11988289/TestRdar 11988289.py +++ b/lldb/test/functionalities/data-formatter/rdar-11988289/TestRdar 11988289.py @@ -62,17 +62,17 @@ class DataFormatterRdar11988289TestCase(TestBase): self.expect('frame variable mutabledict', substrs = ['4 key/value pairs']) self.expect('frame variable dictionary --ptr-depth 1', - substrs = ['3 key/value pairs','[0] = {','key = 0x','value = 0x','[1] = {','[2] = {']) + substrs = ['3 key/value pairs','[0] = ','key = 0x','value = 0x','[1] = ','[2] = ']) self.expect('frame variable mutabledict --ptr-depth 1', - substrs = ['4 key/value pairs','[0] = {','key = 0x','value = 0x','[1] = {','[2] = {','[3] = {']) + substrs = ['4 key/value pairs','[0] = ','key = 0x','value = 0x','[1] = ','[2] = ','[3] = ']) self.expect('frame variable dictionary --ptr-depth 1 --dynamic-type no-run-target', substrs = ['3 key/value pairs','@"bar"','@"2 objects"','@"baz"','2 key/value pairs']) self.expect('frame variable mutabledict --ptr-depth 1 --dynamic-type no-run-target', substrs = ['4 key/value pairs','(int)23','@"123"','@"http://www.apple.com"','@"puartist"','3 key/value pairs']) self.expect('frame variable mutabledict --ptr-depth 2 --dynamic-type no-run-target', - substrs = ['4 key/value pairs','(int)23','@"123"','@"http://www.apple.com"','@"puartist"','3 key/value pairs {','@"bar"','@"2 objects"']) + substrs = ['4 key/value pairs','(int)23','@"123"','@"http://www.apple.com"','@"puartist"','3 key/value pairs','@"bar"','@"2 objects"']) self.expect('frame variable mutabledict --ptr-depth 3 --dynamic-type no-run-target', - substrs = ['4 key/value pairs','(int)23','@"123"','@"http://www.apple.com"','@"puartist"','3 key/value pairs {','@"bar"','@"2 objects"','(int)1','@"two"']) + substrs = ['4 key/value pairs','(int)23','@"123"','@"http://www.apple.com"','@"puartist"','3 key/value pairs','@"bar"','@"2 objects"','(int)1','@"two"']) self.assertTrue(self.frame().FindVariable("dictionary").MightHaveChildren(), "dictionary says it does not have children!") self.assertTrue(self.frame().FindVariable("mutabledict").MightHaveChildren(), "mutable says it does not have children!") diff --git a/lldb/test/functionalities/data-formatter/rdar-13338477/Test-rdar-13338477.py b/lldb/test/functionalities/data-formatter/rdar-13338477/Test-rdar-13338477.py index 6f68df96106..e65cb8b3d5c 100644 --- a/lldb/test/functionalities/data-formatter/rdar-13338477/Test-rdar-13338477.py +++ b/lldb/test/functionalities/data-formatter/rdar-13338477/Test-rdar-13338477.py @@ -55,7 +55,7 @@ class Radar13338477DataFormatterTestCase(TestBase): self.addTearDownHook(cleanup) self.expect('p *(int (*)[3])foo', - substrs = ['(int [3]) $',' = {','[0] = 1','[1] = 2','[2] = 3']) + substrs = ['(int [3]) $','[0] = 1','[1] = 2','[2] = 3']) self.expect('p *(int (*)[3])foo', matching=False, substrs = ['01 00 00 00 02 00 00 00 03 00 00 00']) diff --git a/lldb/test/lang/c/anonymous/TestAnonymous.py b/lldb/test/lang/c/anonymous/TestAnonymous.py index 0bef5bff3f6..d86c31e1e59 100644 --- a/lldb/test/lang/c/anonymous/TestAnonymous.py +++ b/lldb/test/lang/c/anonymous/TestAnonymous.py @@ -130,13 +130,10 @@ class AnonymousTestCase(TestBase): # These should display correctly. self.expect("expression pz", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ["(type_z *) $0 = 0x0000"]) + substrs = ["(type_z *) $", " = 0x0000"]) self.expect("expression z.y", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ["(type_y) $1 = {"]) - - self.expect("expression z", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ["dummy = 2"]) + substrs = ["(type_y) $", "dummy = 2"]) def expr_null(self): self.common_setup(self.line2) |