diff options
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
2 files changed, 48 insertions, 16 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile index 88cb026aba1..beb2fd583e7 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile +++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile @@ -2,14 +2,7 @@ LEVEL = ../../../../../make CXX_SOURCES := main.cpp -CXXFLAGS := -O0 USE_LIBSTDCPP := 1 - -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif +CFLAGS_EXTRAS += $(NO_LIMIT_DEBUG_INFO_FLAGS) include $(LEVEL)/Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py index 8d940c2686a..978c2ac3ed3 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py @@ -31,19 +31,58 @@ class StdSmartPtrDataFormatterTestCase(TestBase): substrs=['stopped', 'stop reason = breakpoint']) self.expect("frame variable nsp", substrs=['nsp = nullptr']) - self.expect("frame variable isp", substrs=['isp = 123']) - self.expect("frame variable ssp", substrs=['ssp = "foobar"']) - + self.expect("frame variable isp", substrs=['isp = 123', 'strong=1', 'weak=1']) + self.expect("frame variable ssp", substrs=['ssp = "foobar"', 'strong=1', 'weak=1']) self.expect("frame variable nwp", substrs=['nwp = nullptr']) - self.expect("frame variable iwp", substrs=['iwp = 123']) - self.expect("frame variable swp", substrs=['swp = "foobar"']) + self.expect("frame variable iwp", substrs=['iwp = 123', 'strong=1', 'weak=1']) + self.expect("frame variable swp", substrs=['swp = "foobar"', 'strong=1', 'weak=1']) + + frame = self.frame() + self.assertTrue(frame.IsValid()) + + self.assertEqual(0, frame.GetValueForVariablePath("nsp.pointer").GetValueAsUnsigned()) + self.assertEqual(0, frame.GetValueForVariablePath("nwp.pointer").GetValueAsUnsigned()) + + self.assertNotEqual(0, frame.GetValueForVariablePath("isp.pointer").GetValueAsUnsigned()) + self.assertEqual(123, frame.GetValueForVariablePath("isp.object").GetValueAsUnsigned()) + self.assertEqual(1, frame.GetValueForVariablePath("isp.count").GetValueAsUnsigned()) + self.assertEqual(1, frame.GetValueForVariablePath("isp.weak_count").GetValueAsUnsigned()) + self.assertFalse(frame.GetValueForVariablePath("isp.foobar").IsValid()) + + self.assertNotEqual(0, frame.GetValueForVariablePath("ssp.pointer").GetValueAsUnsigned()) + self.assertEqual('"foobar"', frame.GetValueForVariablePath("ssp.object").GetSummary()) + self.assertEqual(1, frame.GetValueForVariablePath("ssp.count").GetValueAsUnsigned()) + self.assertEqual(1, frame.GetValueForVariablePath("ssp.weak_count").GetValueAsUnsigned()) + self.assertFalse(frame.GetValueForVariablePath("ssp.foobar").IsValid()) + + self.assertNotEqual(0, frame.GetValueForVariablePath("iwp.pointer").GetValueAsUnsigned()) + self.assertEqual(123, frame.GetValueForVariablePath("iwp.object").GetValueAsUnsigned()) + self.assertEqual(1, frame.GetValueForVariablePath("iwp.count").GetValueAsUnsigned()) + self.assertEqual(1, frame.GetValueForVariablePath("iwp.weak_count").GetValueAsUnsigned()) + self.assertFalse(frame.GetValueForVariablePath("iwp.foobar").IsValid()) + + self.assertNotEqual(0, frame.GetValueForVariablePath("swp.pointer").GetValueAsUnsigned()) + self.assertEqual('"foobar"', frame.GetValueForVariablePath("swp.object").GetSummary()) + self.assertEqual(1, frame.GetValueForVariablePath("swp.count").GetValueAsUnsigned()) + self.assertEqual(1, frame.GetValueForVariablePath("swp.weak_count").GetValueAsUnsigned()) + self.assertFalse(frame.GetValueForVariablePath("swp.foobar").IsValid()) self.runCmd("continue") + frame = self.frame() + self.assertTrue(frame.IsValid()) + self.expect("frame variable nsp", substrs=['nsp = nullptr']) self.expect("frame variable isp", substrs=['isp = nullptr']) self.expect("frame variable ssp", substrs=['ssp = nullptr']) - self.expect("frame variable nwp", substrs=['nwp = nullptr']) - self.expect("frame variable iwp", substrs=['iwp = nullptr']) - self.expect("frame variable swp", substrs=['swp = nullptr']) + self.expect("frame variable iwp", substrs=['iwp = nullptr', 'strong=0', 'weak=1']) + self.expect("frame variable swp", substrs=['swp = nullptr', 'strong=0', 'weak=1']) + + self.assertFalse(frame.GetValueForVariablePath("iwp.object").IsValid()) + self.assertEqual(0, frame.GetValueForVariablePath("iwp.count").GetValueAsUnsigned()) + self.assertEqual(1, frame.GetValueForVariablePath("iwp.weak_count").GetValueAsUnsigned()) + + self.assertFalse(frame.GetValueForVariablePath("swp.object").IsValid()) + self.assertEqual(0, frame.GetValueForVariablePath("swp.count").GetValueAsUnsigned()) + self.assertEqual(1, frame.GetValueForVariablePath("swp.weak_count").GetValueAsUnsigned()) |