Debian Codegraph @

lldb/test/API/commands/frame/var-dil/basics/Indirection/TestFrameVarDILIndirection.py

raw
1 """
2 Make sure 'frame var' using DIL parser/evaluator works for indirection.
3 """
4
5 import lldb
6 from lldbsuite.test.lldbtest import *
7 from lldbsuite.test.decorators import *
8 from lldbsuite.test import lldbutil
9
10 import os
11 import shutil
12 import time
13
14
15 class TestFrameVarDILIndirection(TestBase):
16 # If your test case doesn't stress debug info, then
17 # set this to true. That way it won't be run once for
18 # each debug info format.
19 NO_DEBUG_INFO_TESTCASE = True
20
21 def test_frame_var(self):
22 self.build()
23 lldbutil.run_to_source_breakpoint(
24 self, "Set a breakpoint here", lldb.SBFileSpec("main.cpp")
25 )
26
27 self.runCmd("settings set target.experimental.use-DIL true")
28 self.expect_var_path("*p", value="1")
29 self.expect_var_path("p", type="int *")
30 self.expect_var_path("*my_p", value="1")
31 self.expect_var_path("my_p", type="myp")
32 self.expect_var_path("*my_pr", type="int *")
33 self.expect_var_path("my_pr", type="mypr")
34
35 self.expect(
36 "frame variable '*1'",
37 error=True,
38 substrs=["dereference failed: not a pointer, reference or array type"],
39 )
40 self.expect(
41 "frame variable '*val'",
42 error=True,
43 substrs=[
44 "dereference failed: not a pointer, reference or array type: (int) val"
45 ],
46 )