48 lines · python
1import lldb2from lldbsuite.test.decorators import *3from lldbsuite.test.lldbtest import *4from lldbsuite.test import lldbutil5 6 7class ThunkTest(TestBase):8 def test_step_through_thunk(self):9 self.build()10 lldbutil.run_to_name_breakpoint(self, "testit")11 12 # Make sure we step through the thunk into Derived1::doit13 self.expect(14 "step",15 STEP_IN_SUCCEEDED,16 substrs=["stop reason = step in", "Derived1::doit"],17 )18 19 self.runCmd("continue")20 21 self.expect(22 "step",23 STEP_IN_SUCCEEDED,24 substrs=["stop reason = step in", "Derived2::doit"],25 )26 27 @skipIfWindows28 def test_step_out_thunk(self):29 self.build()30 lldbutil.run_to_name_breakpoint(self, "testit_debug")31 32 # Make sure we step out of the thunk and end up in testit_debug.33 source = "main.cpp"34 line = line_number(source, "// Step here")35 self.expect(36 "step",37 STEP_IN_SUCCEEDED,38 substrs=["stop reason = step in", "{}:{}".format(source, line)],39 )40 41 self.runCmd("continue")42 43 self.expect(44 "step",45 STEP_IN_SUCCEEDED,46 substrs=["stop reason = step in", "Derived2::doit_debug"],47 )48