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