2 from lldbsuite
.test
.decorators
import *
3 from lldbsuite
.test
.lldbtest
import *
4 from lldbsuite
.test
import lldbutil
7 class TestBitfieldIvars(TestBase
):
10 lldbutil
.run_to_source_breakpoint(
11 self
, "// break here", lldb
.SBFileSpec("main.m")
15 "chb->hb->field1", result_type
="unsigned int", result_value
="0"
17 ## This should happen second
19 "chb->hb->field2", result_type
="unsigned int", result_value
="1"
22 self
.expect_expr("hb2->field1", result_type
="unsigned int", result_value
="10")
23 self
.expect_expr("hb2->field2", result_type
="unsigned int", result_value
="3")
24 self
.expect_expr("hb2->field3", result_type
="unsigned int", result_value
="4")
28 substrs
=["x =", "100", "field1 =", "10", "field2 =", "3", "field3 =", "4"],
33 result_type
="UCBitFields",
35 ValueCheck(name
="fieldOne", value
="'\\0'"),
36 ValueCheck(name
="fieldTwo", value
="'\\x01'"),
37 ValueCheck(name
="fieldThree", value
="'\\0'"),
38 ValueCheck(name
="fieldFour", value
="'\\0'"),
39 ValueCheck(name
="fieldFive", value
="'\\x01'"),
43 # This test is meant to be xfailed, but running the test triggers an ASan
44 # issue, so it must be skipped for now.
46 def testExprWholeObject(self
):
48 lldbutil
.run_to_source_breakpoint(
49 self
, "// break here", lldb
.SBFileSpec("main.m")
52 ## FIXME expression with individual bit-fields obtains correct values but not with the whole object
55 substrs
=["x =", "100", "field1 =", "10", "field2 =", "3", "field3 =", "4"],