2 Test that lldb persistent variables works correctly.
8 from lldbsuite.test.lldbtest import *
11 class PersistentVariablesTestCase(TestBase):
13 mydir = TestBase.compute_mydir(__file__)
15 def test_persistent_variables(self):
16 """Test that lldb persistent variables works correctly."""
19 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
21 self.runCmd("breakpoint set --source-pattern-regexp break")
23 self.runCmd("run", RUN_SUCCEEDED)
25 self.runCmd("expression int $i = i")
27 self.expect("expression $i == i",
28 startstr="(bool) $0 = true")
30 self.expect("expression $i + 1",
31 startstr="(int) $1 = 6")
33 self.expect("expression $i + 3",
34 startstr="(int) $2 = 8")
36 self.expect("expression $2 + $1",
37 startstr="(int) $3 = 14")
39 self.expect("expression $3",
40 startstr="(int) $3 = 14")
42 self.expect("expression $2",
43 startstr="(int) $2 = 8")
45 self.expect("expression (int)-2",
46 startstr="(int) $4 = -2")
48 self.expect("expression $4 > (int)31",
49 startstr="(bool) $5 = false")
51 self.expect("expression (long)$4",
52 startstr="(long) $6 = -2")