2 Tests that frame variable looks into anonymous unions
5 from lldbsuite
.test
.lldbtest
import *
6 import lldbsuite
.test
.lldbutil
as lldbutil
9 class FrameVariableAnonymousUnionsTestCase(TestBase
):
10 def test_with_run_command(self
):
11 """Tests that frame variable looks into anonymous unions"""
13 self
.runCmd("file " + self
.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET
)
15 line
= line_number("main.cpp", "// break here")
16 lldbutil
.run_break_set_by_file_and_line(
17 self
, "main.cpp", line
, num_expected_locations
=-1, loc_exact
=False
20 self
.runCmd("process launch", RUN_SUCCEEDED
)
22 process
= self
.dbg
.GetSelectedTarget().GetProcess()
24 if process
.GetByteOrder() == lldb
.eByteOrderLittle
:
25 self
.expect("frame variable -f x i", substrs
=["ffffff41"])
27 self
.expect("frame variable -f x i", substrs
=["41ffff00"])
29 self
.expect("frame variable c", substrs
=["'A"])