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):
11 mydir = TestBase.compute_mydir(__file__)
13 def test_with_run_command(self):
14 """Tests that frame variable looks into anonymous unions"""
16 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
18 line = line_number('main.cpp', '// break here')
19 lldbutil.run_break_set_by_file_and_line(
20 self, "main.cpp", line, num_expected_locations=-1, loc_exact=False)
22 self.runCmd("process launch", RUN_SUCCEEDED)
24 process = self.dbg.GetSelectedTarget().GetProcess()
26 if process.GetByteOrder() == lldb.eByteOrderLittle:
27 self.expect('frame variable -f x i', substrs=['ffffff41'])
29 self.expect('frame variable -f x i', substrs=['41ffff00'])
31 self.expect('frame variable c', substrs=["'A"])
33 self.expect('frame variable x', matching=False, substrs=['3'])
34 self.expect('frame variable y', matching=False, substrs=["'B'"])
35 self.expect('frame variable z', matching=False, substrs=['14'])