aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/lang/cpp/thunk/TestThunk.py
blob: 9370c1c58c18b876b08f1aad38eea2e19b451239 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil


class ThunkTest(TestBase):
    def test_step_through_thunk(self):
        self.build()
        lldbutil.run_to_name_breakpoint(self, "testit")

        # Make sure we step through the thunk into Derived1::doit
        self.expect(
            "step",
            STEP_IN_SUCCEEDED,
            substrs=["stop reason = step in", "Derived1::doit"],
        )

        self.runCmd("continue")

        self.expect(
            "step",
            STEP_IN_SUCCEEDED,
            substrs=["stop reason = step in", "Derived2::doit"],
        )

    @skipIfWindows
    def test_step_out_thunk(self):
        self.build()
        lldbutil.run_to_name_breakpoint(self, "testit_debug")

        # Make sure we step out of the thunk and end up in testit_debug.
        source = "main.cpp"
        line = line_number(source, "// Step here")
        self.expect(
            "step",
            STEP_IN_SUCCEEDED,
            substrs=["stop reason = step in", "{}:{}".format(source, line)],
        )

        self.runCmd("continue")

        self.expect(
            "step",
            STEP_IN_SUCCEEDED,
            substrs=["stop reason = step in", "Derived2::doit_debug"],
        )