1"""
2Test thread step-in [ -r | --step-over-regexp ].
3"""
4
5
6
7import lldb
8from lldbsuite.test.lldbtest import *
9import lldbsuite.test.lldbutil as lldbutil
10from lldbsuite.test.decorators import *
11
12
13class ThreadStepInAvoidRegexTestCase(TestBase):
14
15    def setUp(self):
16        TestBase.setUp(self)
17        self.line2 = line_number('main.c', '// assignment to B2')
18
19    @skipIfWindows
20    def test_step_out_avoid_regexp(self):
21        """Exercise thread step-in -r"""
22        self.build()
23        lldbutil.run_to_source_breakpoint(self,
24                'frame select 2, thread step-out while stopped',
25                lldb.SBFileSpec('main.c'))
26
27        # Now step in, skipping the frames for 'b' and 'a'.
28        self.runCmd("thread step-in -r 'a'")
29
30        # We should be at the assignment to B2.
31        self.expect("thread backtrace", STEP_IN_SUCCEEDED,
32                    substrs=["stop reason = step in"],
33                    patterns=["frame #0.*main.c:%d" % self.line2])
34