brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 0e35069 Raw
44 lines · python
1"""2Make sure 'frame var' using DIL parser/evaluator works for bit fields.3"""4 5import lldb6from lldbsuite.test.lldbtest import *7from lldbsuite.test.decorators import *8from lldbsuite.test import lldbutil9 10import os11import shutil12import time13 14 15class TestFrameVarDILBitField(TestBase):16    # If your test case doesn't stress debug info, then17    # set this to true.  That way it won't be run once for18    # each debug info format.19    NO_DEBUG_INFO_TESTCASE = True20 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("bf.a", value="1023")29        self.expect_var_path("bf.b", value="9")30        self.expect_var_path("bf.c", value="false")31        self.expect_var_path("bf.d", value="true")32 33        self.expect_var_path("abf.a", value="1023")34        self.expect_var_path("abf.b", value="'\\x0f'")35        self.expect_var_path("abf.c", value="3")36 37        # Perform an operation to ensure we actually read the value.38        # Address-of is not allowed for bit-fields.39        self.expect(40            "frame variable '&bf.a'",41            error=True,42            substrs=["'bf.a' doesn't have a valid address"],43        )44