2 Test regression for Bug 25251.
7 from lldbsuite.test.decorators import *
8 from lldbsuite.test.lldbtest import *
9 from lldbsuite.test import lldbutil
12 class BacktraceAllTestCase(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(
21 'ParallelTask.cpp', '// Set breakpoint here')
23 # The android-arm compiler can't compile the inferior
24 @skipIfTargetAndroid(archs=["arm"])
25 # because of an issue around std::future.
26 # TODO: Change the test to don't depend on std::future<T>
28 """Test breakpoint handling after a thread join."""
29 self.build(dictionary=self.getBuildFlags())
31 exe = self.getBuildArtifact("a.out")
32 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
34 # This should create a breakpoint
35 lldbutil.run_break_set_by_file_and_line(
36 self, "ParallelTask.cpp", self.breakpoint, num_expected_locations=-1)
38 # The breakpoint list should show 1 location.
41 "Breakpoint location shown correctly",
43 "1: file = 'ParallelTask.cpp', line = %d, exact_match = 0" %
47 self.runCmd("run", RUN_SUCCEEDED)
49 # The stop reason of the thread should be breakpoint.
50 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
52 'stop reason = breakpoint'])
54 # This should not result in a segmentation fault
55 self.expect("thread backtrace all", STOPPED_DUE_TO_BREAKPOINT,
56 substrs=["stop reason = breakpoint 1."])
59 self.runCmd("continue")
61 if __name__ == '__main__':
63 lldb.SBDebugger.Initialize()
64 atexit.register(lambda: lldb.SBDebugger.Terminate())