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
28 lines
777 B
Python
28 lines
777 B
Python
"""
|
|
Test the robustness of lldb expression parser.
|
|
"""
|
|
|
|
|
|
import lldb
|
|
from lldbsuite.test.lldbtest import *
|
|
|
|
|
|
class Radar8638051TestCase(TestBase):
|
|
def test_expr_commands(self):
|
|
"""The following expression commands should not crash."""
|
|
self.build()
|
|
|
|
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
|
|
|
|
self.runCmd("breakpoint set -n c")
|
|
|
|
self.runCmd("run", RUN_SUCCEEDED)
|
|
|
|
self.expect_expr("val", result_type="int", result_value="1")
|
|
self.expect_expr("*(&val)", result_type="int", result_value="1")
|
|
|
|
# rdar://problem/8638051
|
|
# lldb expression command: Could this crash be avoided
|
|
self.expect("expression &val", startstr="(int *) $2 = ")
|
|
# (int *) $2 = 0x....
|