2 Test regression for Bug 25251.
9 from lldbsuite.test.decorators import *
10 from lldbsuite.test.lldbtest import *
11 from lldbsuite.test import lldbutil
14 class BreakpointAfterJoinTestCase(TestBase):
16 mydir = TestBase.compute_mydir(__file__)
19 # Call super's setUp().
21 # Find the line number for our breakpoint.
22 self.breakpoint = line_number(
23 'ParallelTask.cpp', '// Set breakpoint here')
25 # The android-arm compiler can't compile the inferior
26 @skipIfTargetAndroid(archs=["arm"])
27 # because of an issue around std::future.
28 # TODO: Change the test to don't depend on std::future<T>
30 """Test breakpoint handling after a thread join."""
31 self.build(dictionary=self.getBuildFlags())
33 exe = os.path.join(os.getcwd(), "a.out")
34 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
36 # This should create a breakpoint
37 lldbutil.run_break_set_by_file_and_line(
38 self, "ParallelTask.cpp", self.breakpoint, num_expected_locations=-1)
40 # The breakpoint list should show 1 location.
43 "Breakpoint location shown correctly",
45 "1: file = 'ParallelTask.cpp', line = %d, exact_match = 0" %
49 self.runCmd("run", RUN_SUCCEEDED)
51 # The stop reason of the thread should be breakpoint.
52 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
54 'stop reason = breakpoint'])
56 # This should not result in a segmentation fault
57 self.expect("thread backtrace all", STOPPED_DUE_TO_BREAKPOINT,
58 substrs=["stop reason = breakpoint 1."])
61 self.runCmd("continue")
63 if __name__ == '__main__':
65 lldb.SBDebugger.Initialize()
66 atexit.register(lambda: lldb.SBDebugger.Terminate())