2 Test lldb data formatter subsystem.
7 from lldbsuite.test.decorators import *
8 from lldbsuite.test.lldbtest import *
9 from lldbsuite.test import lldbutil
12 class StdTupleDataFormatterTestCase(TestBase):
13 mydir = TestBase.compute_mydir(__file__)
15 @add_test_categories(["libstdcxx"])
16 def test_with_run_command(self):
18 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
20 lldbutil.run_break_set_by_source_regexp(
21 self, "Set break point at this line.")
22 self.runCmd("run", RUN_SUCCEEDED)
24 # The stop reason of the thread should be breakpoint.
25 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
26 substrs=['stopped', 'stop reason = breakpoint'])
29 self.assertTrue(frame.IsValid())
31 self.expect("frame variable ti", substrs=['[0] = 1'])
32 self.expect("frame variable ts", substrs=['[0] = "foobar"'])
33 self.expect("frame variable tt", substrs=['[0] = 1', '[1] = "baz"', '[2] = 2'])
35 self.assertEqual(1, frame.GetValueForVariablePath("ti[0]").GetValueAsUnsigned())
36 self.assertFalse(frame.GetValueForVariablePath("ti[1]").IsValid())
38 self.assertEqual('"foobar"', frame.GetValueForVariablePath("ts[0]").GetSummary())
39 self.assertFalse(frame.GetValueForVariablePath("ts[1]").IsValid())
41 self.assertEqual(1, frame.GetValueForVariablePath("tt[0]").GetValueAsUnsigned())
42 self.assertEqual('"baz"', frame.GetValueForVariablePath("tt[1]").GetSummary())
43 self.assertEqual(2, frame.GetValueForVariablePath("tt[2]").GetValueAsUnsigned())
44 self.assertFalse(frame.GetValueForVariablePath("tt[3]").IsValid())