Debian Codegraph @

lldb/test/API/commands/frame/var-dil/basics/SyntheticDereference/TestFrameVarDILSyntheticDereference.py

raw
1 """
2 Test code for dereferencing synthetic wrapped pointers.
3 """
4
5 import lldb
6 from lldbsuite.test.decorators import *
7 from lldbsuite.test.lldbtest import *
8 from lldbsuite.test import lldbutil
9
10
11 class DILSyntheticDereferenceTestCase(TestBase):
12 # If your test case doesn't stress debug info, then
13 # set this to true. That way it won't be run once for
14 # each debug info format.
15 NO_DEBUG_INFO_TESTCASE = True
16
17 def test_frame_var(self):
18 self.build()
19 lldbutil.run_to_source_breakpoint(
20 self, "Set a breakpoint here", lldb.SBFileSpec("main.cpp")
21 )
22
23 self.runCmd("settings set target.experimental.use-DIL true")
24 self.runCmd("script from wrapPtrSynthProvider import *")
25 self.runCmd("type synth add -l wrapPtrSynthProvider wrap_ptr")
26
27 self.expect_var_path("ptr_node->value", value="1")
28 self.expect_var_path("ptr_node->next->value", value="2")
29 self.expect_var_path("(*ptr_node).value", value="1")
30 self.expect_var_path("(*(*ptr_node).next).value", value="2")
31
32 self.expect_var_path("ptr_node.ptr", type="NodeS *")
33 self.expect_var_path("ptr_node.ptr->value", value="1")
34 self.expect_var_path("ptr_node.ptr->next.ptr->value", value="2")