df213a03c72ac02745917457a960d29bcf60dab5
[openbsd] /
1 """
2 Test lldb data formatter subsystem.
3 """
4
5
6 import lldb
7 from lldbsuite.test.decorators import *
8 from lldbsuite.test.lldbtest import *
9 from lldbsuite.test import lldbutil
10
11
12 class StdSmartPtrDataFormatterTestCase(TestBase):
13     mydir = TestBase.compute_mydir(__file__)
14
15     @add_test_categories(["libstdcxx"])
16     def test_with_run_command(self):
17         self.build()
18         self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
19
20         lldbutil.run_break_set_by_source_regexp(
21             self, "Set break point at this line.")
22         self.runCmd("run", RUN_SUCCEEDED)
23
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'])
27
28         self.expect("frame variable nsp", substrs=['nsp = nullptr'])
29         self.expect("frame variable isp", substrs=['isp = 123'])
30         self.expect("frame variable ssp", substrs=['ssp = "foobar"'])
31
32         self.expect("frame variable nwp", substrs=['nwp = nullptr'])
33         self.expect("frame variable iwp", substrs=['iwp = 123'])
34         self.expect("frame variable swp", substrs=['swp = "foobar"'])
35
36         self.runCmd("continue")
37
38         self.expect("frame variable nsp", substrs=['nsp = nullptr'])
39         self.expect("frame variable isp", substrs=['isp = nullptr'])
40         self.expect("frame variable ssp", substrs=['ssp = nullptr'])
41
42         self.expect("frame variable nwp", substrs=['nwp = nullptr'])
43         self.expect("frame variable iwp", substrs=['iwp = nullptr'])
44         self.expect("frame variable swp", substrs=['swp = nullptr'])