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