• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"""
2Test that we can have persistent pointer variables
3"""
4
5
6
7import lldb
8import lldbsuite.test.lldbutil as lldbutil
9from lldbsuite.test.lldbtest import *
10
11
12class PersistentPtrUpdateTestCase(TestBase):
13
14    mydir = TestBase.compute_mydir(__file__)
15
16    def test(self):
17        """Test that we can have persistent pointer variables"""
18        self.build()
19
20        def cleanup():
21            pass
22
23        # Execute the cleanup function during test case tear down.
24        self.addTearDownHook(cleanup)
25
26        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
27
28        self.runCmd('break set -p here')
29
30        self.runCmd("run", RUN_SUCCEEDED)
31
32        self.runCmd("expr void* $foo = 0")
33
34        self.runCmd("continue")
35
36        self.expect("expr $foo", substrs=['$foo', '0x0'])
37