Author: labath Date: Wed Apr 12 07:32:58 2017 New Revision: 300054 URL: http://llvm.org/viewvc/llvm-project?rev=300054&view=rev Log: Add libc++ category to the remaining libc++ data formatters
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py?rev=300054&r1=300053&r2=300054&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py Wed Apr 12 07:32:58 2017 @@ -23,8 +23,7 @@ class LibCxxFunctionTestCase(TestBase): var.SetPreferSyntheticValue(True) return var - @skipIf(compiler="gcc") - @skipIfWindows # libc++ not ported to Windows yet + @add_test_categories(["libc++"]) def test(self): """Test that std::function as defined by libc++ is correctly printed by LLDB""" self.build() @@ -36,9 +35,6 @@ class LibCxxFunctionTestCase(TestBase): self.runCmd("run", RUN_SUCCEEDED) - lldbutil.skip_if_library_missing( - self, self.target(), lldbutil.PrintableRegex("libc\+\+")) - # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs=['stopped', Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py?rev=300054&r1=300053&r2=300054&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py Wed Apr 12 07:32:58 2017 @@ -22,9 +22,10 @@ class LibcxxIteratorDataFormatterTestCas TestBase.setUp(self) # Find the line number to break at. self.line = line_number('main.cpp', '// Set break point at this line.') + ns = 'ndk' if lldbplatformutil.target_is_android() else '' + self.namespace = 'std::__' + ns + '1' - @skipIf(compiler="gcc") - @skipIfWindows # libc++ not ported to Windows yet + @add_test_categories(["libc++"]) def test_with_run_command(self): """Test that libc++ iterators format properly.""" self.build() @@ -35,9 +36,6 @@ class LibcxxIteratorDataFormatterTestCas self.runCmd("run", RUN_SUCCEEDED) - lldbutil.skip_if_library_missing( - self, self.target(), lldbutil.PrintableRegex("libc\+\+")) - # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs=['stopped', @@ -57,8 +55,6 @@ class LibcxxIteratorDataFormatterTestCas # Execute the cleanup function during test case tear down. self.addTearDownHook(cleanup) - self.expect('image list', substrs=self.getLibcPlusPlusLibs()) - self.expect('frame variable ivI', substrs=['item = 3']) self.expect('expr ivI', substrs=['item = 3']) Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py?rev=300054&r1=300053&r2=300054&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py Wed Apr 12 07:32:58 2017 @@ -19,9 +19,8 @@ class LibcxxListDataFormatterTestCase(Te mydir = TestBase.compute_mydir(__file__) - @skipIf(compiler="gcc") - @skipIfWindows # libc++ not ported to Windows yet - @add_test_categories(["pyapi"]) + @add_test_categories(["libc++"]) + @expectedFailureAndroid(bugnumber="llvm.org/pr32592") @skipIfDarwin # rdar://25499635 def test_with_run_command(self): self.build() @@ -40,8 +39,6 @@ class LibcxxListDataFormatterTestCase(Te # Run the program, it should stop at breakpoint 1. process = target.LaunchSimple( None, None, self.get_process_working_directory()) - lldbutil.skip_if_library_missing( - self, target, lldbutil.PrintableRegex("libc\+\+")) self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID) self.assertEqual( len(lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint1)), 1) Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py?rev=300054&r1=300053&r2=300054&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py Wed Apr 12 07:32:58 2017 @@ -17,8 +17,12 @@ class LibcxxMapDataFormatterTestCase(Tes mydir = TestBase.compute_mydir(__file__) - @skipIf(compiler="gcc") - @skipIfWindows # libc++ not ported to Windows yet + def setUp(self): + TestBase.setUp(self) + ns = 'ndk' if lldbplatformutil.target_is_android() else '' + self.namespace = 'std::__' + ns + '1' + + @add_test_categories(["libc++"]) def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() @@ -30,9 +34,6 @@ class LibcxxMapDataFormatterTestCase(Tes self.runCmd("run", RUN_SUCCEEDED) - lldbutil.skip_if_library_missing( - self, self.target(), lldbutil.PrintableRegex("libc\+\+")) - # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs=['stopped', @@ -52,16 +53,16 @@ class LibcxxMapDataFormatterTestCase(Tes # Execute the cleanup function during test case tear down. self.addTearDownHook(cleanup) - self.expect('image list', substrs=self.getLibcPlusPlusLibs()) - + ns = self.namespace self.expect('frame variable ii', - substrs=['size=0', + substrs=['%s::map' % ns, + 'size=0', '{}']) lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable ii', - substrs=['size=2', + substrs=['%s::map' % ns, 'size=2', '[0] = ', 'first = 0', 'second = 0', @@ -72,7 +73,7 @@ class LibcxxMapDataFormatterTestCase(Tes lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable ii', - substrs=['size=4', + substrs=['%s::map' % ns, 'size=4', '[2] = ', 'first = 2', 'second = 0', @@ -83,7 +84,7 @@ class LibcxxMapDataFormatterTestCase(Tes lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect("frame variable ii", - substrs=['size=8', + substrs=['%s::map' % ns, 'size=8', '[5] = ', 'first = 5', 'second = 0', @@ -92,7 +93,7 @@ class LibcxxMapDataFormatterTestCase(Tes 'second = 1']) self.expect("p ii", - substrs=['size=8', + substrs=['%s::map' % ns, 'size=8', '[5] = ', 'first = 5', 'second = 0', @@ -124,17 +125,17 @@ class LibcxxMapDataFormatterTestCase(Tes self.runCmd("continue") self.expect('frame variable ii', - substrs=['size=0', + substrs=['%s::map' % ns, 'size=0', '{}']) self.expect('frame variable si', - substrs=['size=0', + substrs=['%s::map' % ns, 'size=0', '{}']) self.runCmd("continue") self.expect('frame variable si', - substrs=['size=1', + substrs=['%s::map' % ns, 'size=1', '[0] = ', 'first = \"zero\"', 'second = 0']) @@ -142,7 +143,7 @@ class LibcxxMapDataFormatterTestCase(Tes lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect("frame variable si", - substrs=['size=4', + substrs=['%s::map' % ns, 'size=4', '[0] = ', 'first = \"zero\"', 'second = 0', @@ -157,7 +158,7 @@ class LibcxxMapDataFormatterTestCase(Tes 'second = 3']) self.expect("p si", - substrs=['size=4', + substrs=['%s::map' % ns, 'size=4', '[0] = ', 'first = \"zero\"', 'second = 0', @@ -192,19 +193,19 @@ class LibcxxMapDataFormatterTestCase(Tes lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable si', - substrs=['size=0', + substrs=['%s::map' % ns, 'size=0', '{}']) lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable is', - substrs=['size=0', + substrs=['%s::map' % ns, 'size=0', '{}']) lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect("frame variable is", - substrs=['size=4', + substrs=['%s::map' % ns, 'size=4', '[0] = ', 'second = \"goofy\"', 'first = 85', @@ -219,7 +220,7 @@ class LibcxxMapDataFormatterTestCase(Tes 'first = 3']) self.expect("p is", - substrs=['size=4', + substrs=['%s::map' % ns, 'size=4', '[0] = ', 'second = \"goofy\"', 'first = 85', @@ -254,19 +255,19 @@ class LibcxxMapDataFormatterTestCase(Tes lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable is', - substrs=['size=0', + substrs=['%s::map' % ns, 'size=0', '{}']) lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable ss', - substrs=['size=0', + substrs=['%s::map' % ns, 'size=0', '{}']) lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect("frame variable ss", - substrs=['size=3', + substrs=['%s::map' % ns, 'size=3', '[0] = ', 'second = \"hello\"', 'first = \"ciao\"', @@ -278,7 +279,7 @@ class LibcxxMapDataFormatterTestCase(Tes 'first = \"gatto\"']) self.expect("p ss", - substrs=['size=3', + substrs=['%s::map' % ns, 'size=3', '[0] = ', 'second = \"hello\"', 'first = \"ciao\"', @@ -309,5 +310,5 @@ class LibcxxMapDataFormatterTestCase(Tes lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable ss', - substrs=['size=0', + substrs=['%s::map' % ns, 'size=0', '{}']) Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py?rev=300054&r1=300053&r2=300054&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py Wed Apr 12 07:32:58 2017 @@ -18,8 +18,12 @@ class LibcxxMultiMapDataFormatterTestCas mydir = TestBase.compute_mydir(__file__) - @skipIfWindows # libc++ not ported to Windows yet - @skipIf(compiler="gcc") + def setUp(self): + TestBase.setUp(self) + ns = 'ndk' if lldbplatformutil.target_is_android() else '' + self.namespace = 'std::__' + ns + '1' + + @add_test_categories(["libc++"]) def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() @@ -31,9 +35,6 @@ class LibcxxMultiMapDataFormatterTestCas self.runCmd("run", RUN_SUCCEEDED) - lldbutil.skip_if_library_missing( - self, self.target(), lldbutil.PrintableRegex("libc\+\+")) - # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs=['stopped', @@ -53,16 +54,15 @@ class LibcxxMultiMapDataFormatterTestCas # Execute the cleanup function during test case tear down. self.addTearDownHook(cleanup) - self.expect('image list', substrs=self.getLibcPlusPlusLibs()) - + multimap = self.namespace + "::multimap" self.expect('frame variable ii', - substrs=['size=0', + substrs=[multimap, 'size=0', '{}']) lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable ii', - substrs=['size=2', + substrs=[multimap, 'size=2', '[0] = ', 'first = 0', 'second = 0', @@ -73,7 +73,7 @@ class LibcxxMultiMapDataFormatterTestCas lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable ii', - substrs=['size=4', + substrs=[multimap, 'size=4', '[2] = ', 'first = 2', 'second = 0', @@ -84,7 +84,7 @@ class LibcxxMultiMapDataFormatterTestCas lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect("frame variable ii", - substrs=['size=8', + substrs=[multimap, 'size=8', '[5] = ', 'first = 5', 'second = 0', @@ -93,7 +93,7 @@ class LibcxxMultiMapDataFormatterTestCas 'second = 1']) self.expect("p ii", - substrs=['size=8', + substrs=[multimap, 'size=8', '[5] = ', 'first = 5', 'second = 0', @@ -125,17 +125,17 @@ class LibcxxMultiMapDataFormatterTestCas lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable ii', - substrs=['size=0', + substrs=[multimap, 'size=0', '{}']) self.expect('frame variable si', - substrs=['size=0', + substrs=[multimap, 'size=0', '{}']) lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable si', - substrs=['size=1', + substrs=[multimap, 'size=1', '[0] = ', 'first = \"zero\"', 'second = 0']) @@ -143,7 +143,7 @@ class LibcxxMultiMapDataFormatterTestCas lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect("frame variable si", - substrs=['size=4', + substrs=[multimap, 'size=4', '[0] = ', 'first = \"zero\"', 'second = 0', @@ -158,7 +158,7 @@ class LibcxxMultiMapDataFormatterTestCas 'second = 3']) self.expect("p si", - substrs=['size=4', + substrs=[multimap, 'size=4', '[0] = ', 'first = \"zero\"', 'second = 0', @@ -193,19 +193,19 @@ class LibcxxMultiMapDataFormatterTestCas lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable si', - substrs=['size=0', + substrs=[multimap, 'size=0', '{}']) lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable is', - substrs=['size=0', + substrs=[multimap, 'size=0', '{}']) lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect("frame variable is", - substrs=['size=4', + substrs=[multimap, 'size=4', '[0] = ', 'second = \"goofy\"', 'first = 85', @@ -220,7 +220,7 @@ class LibcxxMultiMapDataFormatterTestCas 'first = 3']) self.expect("p is", - substrs=['size=4', + substrs=[multimap, 'size=4', '[0] = ', 'second = \"goofy\"', 'first = 85', @@ -255,19 +255,19 @@ class LibcxxMultiMapDataFormatterTestCas lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable is', - substrs=['size=0', + substrs=[multimap, 'size=0', '{}']) lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable ss', - substrs=['size=0', + substrs=[multimap, 'size=0', '{}']) lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect("frame variable ss", - substrs=['size=3', + substrs=[multimap, 'size=3', '[0] = ', 'second = \"hello\"', 'first = \"ciao\"', @@ -279,7 +279,7 @@ class LibcxxMultiMapDataFormatterTestCas 'first = \"gatto\"']) self.expect("p ss", - substrs=['size=3', + substrs=[multimap, 'size=3', '[0] = ', 'second = \"hello\"', 'first = \"ciao\"', @@ -310,5 +310,5 @@ class LibcxxMultiMapDataFormatterTestCas lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect('frame variable ss', - substrs=['size=0', + substrs=[multimap, 'size=0', '{}']) Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py?rev=300054&r1=300053&r2=300054&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py Wed Apr 12 07:32:58 2017 @@ -17,8 +17,17 @@ class LibcxxMultiSetDataFormatterTestCas mydir = TestBase.compute_mydir(__file__) - @skipIf(compiler="gcc") - @skipIfWindows # libc++ not ported to Windows yet + def setUp(self): + TestBase.setUp(self) + ns = 'ndk' if lldbplatformutil.target_is_android() else '' + self.namespace = 'std::__' + ns + '1' + + def getVariableType(self, name): + var = self.frame().FindVariable(name) + self.assertTrue(var.IsValid()) + return var.GetType().GetCanonicalType().GetName() + + @add_test_categories(["libc++"]) def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() @@ -30,9 +39,6 @@ class LibcxxMultiSetDataFormatterTestCas self.runCmd("run", RUN_SUCCEEDED) - lldbutil.skip_if_library_missing( - self, self.target(), lldbutil.PrintableRegex("libc\+\+")) - # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs=['stopped', @@ -52,7 +58,9 @@ class LibcxxMultiSetDataFormatterTestCas # Execute the cleanup function during test case tear down. self.addTearDownHook(cleanup) - self.expect('image list', substrs=self.getLibcPlusPlusLibs()) + ii_type = self.getVariableType("ii") + self.assertTrue(ii_type.startswith(self.namespace + "::multiset"), + "Type: " + ii_type) self.expect("frame variable ii", substrs=["size=0", "{}"]) lldbutil.continue_to_breakpoint(self.process(), bkpt) @@ -86,6 +94,9 @@ class LibcxxMultiSetDataFormatterTestCas self.expect("frame variable ii", substrs=["size=0", "{}"]) lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect("frame variable ii", substrs=["size=0", "{}"]) + ss_type = self.getVariableType("ss") + self.assertTrue(ss_type.startswith(self.namespace + "::multiset"), + "Type: " + ss_type) self.expect("frame variable ss", substrs=["size=0", "{}"]) lldbutil.continue_to_breakpoint(self.process(), bkpt) self.expect( Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=300054&r1=300053&r2=300054&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp (original) +++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Wed Apr 12 07:32:58 2017 @@ -707,7 +707,7 @@ static void LoadLibCxxFormatters(lldb::T AddCXXSynthetic( cpp_category_sp, lldb_private::formatters::LibcxxFunctionFrontEndCreator, "std::function synthetic value provider", - ConstString("^std::__1::function<.+>$"), stl_synth_flags, true); + ConstString("^std::__(ndk)?1::function<.+>$"), stl_synth_flags, true); #endif } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits