2 Test lldb data formatter subsystem.
5 from __future__ import print_function
10 from lldbsuite.test.decorators import *
11 from lldbsuite.test.lldbtest import *
12 from lldbsuite.test import lldbutil
15 class StdTupleDataFormatterTestCase(TestBase):
16 mydir = TestBase.compute_mydir(__file__)
19 @skipIfWindows # libstdcpp not ported to Windows
20 @skipIfDarwin # doesn't compile on Darwin
21 def test_with_run_command(self):
23 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
25 lldbutil.run_break_set_by_source_regexp(
26 self, "Set break point at this line.")
27 self.runCmd("run", RUN_SUCCEEDED)
29 # The stop reason of the thread should be breakpoint.
30 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
31 substrs=['stopped', 'stop reason = breakpoint'])
34 self.assertTrue(frame.IsValid())
36 self.expect("frame variable ti", substrs=['[0] = 1'])
37 self.expect("frame variable ts", substrs=['[0] = "foobar"'])
38 self.expect("frame variable tt", substrs=['[0] = 1', '[1] = "baz"', '[2] = 2'])
40 self.assertEqual(1, frame.GetValueForVariablePath("ti[0]").GetValueAsUnsigned())
41 self.assertFalse(frame.GetValueForVariablePath("ti[1]").IsValid())
43 self.assertEqual('"foobar"', frame.GetValueForVariablePath("ts[0]").GetSummary())
44 self.assertFalse(frame.GetValueForVariablePath("ts[1]").IsValid())
46 self.assertEqual(1, frame.GetValueForVariablePath("tt[0]").GetValueAsUnsigned())
47 self.assertEqual('"baz"', frame.GetValueForVariablePath("tt[1]").GetSummary())
48 self.assertEqual(2, frame.GetValueForVariablePath("tt[2]").GetValueAsUnsigned())
49 self.assertFalse(frame.GetValueForVariablePath("tt[3]").IsValid())