brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · ffb4474 Raw
49 lines · python
1"""2Test DIL pointer dereferencing.3"""4 5import lldb6from lldbsuite.test.lldbtest import *7from lldbsuite.test.decorators import *8from lldbsuite.test import lldbutil9 10import os11import shutil12import time13 14 15class TestFrameVarDILPointerDereference(TestBase):16    NO_DEBUG_INFO_TESTCASE = True17 18    def test_frame_var(self):19        self.build()20        lldbutil.run_to_source_breakpoint(21            self, "Set a breakpoint here", lldb.SBFileSpec("main.cpp")22        )23 24        self.runCmd("settings set target.experimental.use-DIL true")25        self.expect_var_path("*p_int0", value="0")26        self.expect_var_path("*cp_int5", value="5")27        self.expect_var_path("&pp_void0[2]", type="void **")28        self.expect_var_path("**pp_int0", value="0")29        self.expect_var_path("&**pp_int0", type="int *")30        self.expect(31            "frame variable '&p_void[0]'",32            error=True,33            substrs=["subscript of pointer to incomplete type 'void'"],34        )35 36        # Verify some of the returned values.37        pp_void0_2_got = self.expect_var_path("&pp_void0[2]", type="void **")38        # Initialized in C++ code to point to the same value39        pp_void0_2_exp = self.expect_var_path("pp_void0_2", type="void **")40        self.assertEqual(41            pp_void0_2_got.GetValueAsAddress(), pp_void0_2_exp.GetValueAsAddress()42        )43        pp_int0_2stars_got = self.expect_var_path("&**pp_int0", type="int *")44        pp_int0_2stars_exp = self.expect_var_path("pp_int0_2stars", type="int *")45        self.assertEqual(46            pp_int0_2stars_got.GetValueAsAddress(),47            pp_int0_2stars_exp.GetValueAsAddress(),48        )49