2 Test that step-inst over a crash behaves correctly.
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
13 class CrashDuringStepTestCase(TestBase):
15 mydir = TestBase.compute_mydir(__file__)
19 self.breakpoint = line_number('main.cpp', '// Set breakpoint here')
21 # IO error due to breakpoint at invalid address
22 @expectedFailureAll(triple=re.compile('^mips'))
23 def test_step_inst_with(self):
24 """Test thread creation during step-inst handling."""
25 self.build(dictionary=self.getBuildFlags())
26 exe = self.getBuildArtifact("a.out")
28 target = self.dbg.CreateTarget(exe)
29 self.assertTrue(target and target.IsValid(), "Target is valid")
31 self.bp_num = lldbutil.run_break_set_by_file_and_line(
32 self, "main.cpp", self.breakpoint, num_expected_locations=1)
35 process = target.LaunchSimple(
36 None, None, self.get_process_working_directory())
37 self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID)
39 # The stop reason should be breakpoint.
44 thread = lldbutil.get_stopped_thread(
45 process, lldb.eStopReasonBreakpoint)
46 self.assertTrue(thread.IsValid(), STOPPED_DUE_TO_BREAKPOINT)
48 # Keep stepping until the inferior crashes
49 while process.GetState() == lldb.eStateStopped and not lldbutil.is_thread_crashed(self, thread):
50 thread.StepInstruction(False)
57 lldbutil.is_thread_crashed(