1""" 2Test calling a function, stopping in the call, continue and gather the result on stop. 3""" 4 5import lldb 6from lldbsuite.test.lldbtest import * 7from lldbsuite.test import lldbutil 8 9class ExprCommandCallStopContinueTestCase(TestBase): 10 11 mydir = TestBase.compute_mydir(__file__) 12 13 def setUp(self): 14 # Call super's setUp(). 15 TestBase.setUp(self) 16 # Find the line number to break for main.c. 17 18 def test(self): 19 """Test gathering result from interrupted function call.""" 20 self.build() 21 lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.cpp")) 22 23 lldbutil.run_break_set_by_file_and_line( 24 self, 25 "main.cpp", 26 line_number('main.cpp', '{5, "five"}'), 27 num_expected_locations=-1, 28 loc_exact=True) 29 30 self.expect("expr -i false -- returnsFive()", error=True, 31 substrs=['Execution was interrupted, reason: breakpoint']) 32 33 self.runCmd("continue", "Continue completed") 34 self.expect( 35 "thread list", 36 substrs=[ 37 'stop reason = User Expression thread plan', 38 r'Completed expression: (Five) $0 = (number = 5, name = "five")']) 39