Files
clang-p2996/lldb/test/API/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
Jonas Devlieghere 2238dcc393 [NFC][Py Reformat] Reformat python files in lldb
This is an ongoing series of commits that are reformatting our Python
code. Reformatting is done with `black` (23.1.0).

If you end up having problems merging this commit because you have made
changes to a python file, the best way to handle that is to run `git
checkout --ours <yourfile>` and then reformat it with black.

RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style

Differential revision: https://reviews.llvm.org/D151460
2023-05-25 12:54:09 -07:00

30 lines
1007 B
Python

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