2 Test that hitting a UBSan issue while running user expression doesn't break the evaluation.
6 from lldbsuite.test.lldbtest import *
7 from lldbsuite.test.decorators import *
8 import lldbsuite.test.lldbutil as lldbutil
11 class UbsanUserExpressionTestCase(TestBase):
13 mydir = TestBase.compute_mydir(__file__)
15 @skipUnlessUndefinedBehaviorSanitizer
21 # Call super's setUp().
23 self.line_breakpoint = line_number('main.c', '// breakpoint line')
25 def ubsan_tests(self):
27 exe = self.getBuildArtifact("a.out")
30 patterns=["Current executable set to .*a.out"])
32 self.runCmd("breakpoint set -f main.c -l %d" % self.line_breakpoint)
36 process = self.dbg.GetSelectedTarget().process
37 thread = process.GetSelectedThread()
38 frame = thread.GetSelectedFrame()
40 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
41 substrs=['stopped', 'stop reason = breakpoint'])
43 self.expect("p foo()", substrs=["(int) $0 = 42"])
45 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
46 substrs=['stopped', 'stop reason = breakpoint'])