xref: /llvm-project/lldb/test/API/functionalities/step-vrs-interrupt/TestStepVrsInterruptTimeout.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
1"""
2This is to make sure that the interrupt timer
3doesn't influence synchronous user level stepping.
4"""
5
6import lldb
7import lldbsuite.test.lldbutil as lldbutil
8from lldbsuite.test.lldbtest import *
9
10
11class TestStepVrsInterruptTimeout(TestBase):
12    NO_DEBUG_INFO_TESTCASE = True
13
14    def test_step_vrs_interrupt(self):
15        """This test is to make sure that the interrupt timeout
16        doesn't cause use to flub events from a synchronous step."""
17        self.build()
18        self.main_source_file = lldb.SBFileSpec("main.cpp")
19        self.sample_test()
20
21    def sample_test(self):
22        """You might use the test implementation in several ways, say so here."""
23
24        # This function starts a process, "a.out" by default, sets a source
25        # breakpoint, runs to it, and returns the thread, process & target.
26        # It optionally takes an SBLaunchOption argument if you want to pass
27        # arguments or environment variables.
28        (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
29            self, "Set a breakpoint here", self.main_source_file
30        )
31        self.dbg.SetAsync(False)
32        self.runCmd("settings set target.process.interrupt-timeout 1")
33        thread.StepOver()
34        self.assertState(
35            process.GetState(), lldb.eStateStopped, "Stopped like we should"
36        )
37