2 Test calling a function, stopping in the call, continue and gather the result on stop.
8 from lldbsuite.test.lldbtest import *
9 from lldbsuite.test import lldbutil
12 class ExprCommandCallStopContinueTestCase(TestBase):
14 mydir = TestBase.compute_mydir(__file__)
17 # Call super's setUp().
19 # Find the line number to break for main.c.
20 self.line = line_number(
22 '// Please test these expressions while stopped at this line:')
23 self.func_line = line_number('main.cpp', '{5, "five"}')
26 """Test gathering result from interrupted function call."""
28 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
30 # Some versions of GCC encode two locations for the 'return' statement
32 lldbutil.run_break_set_by_file_and_line(
33 self, "main.cpp", self.line, num_expected_locations=-1, loc_exact=True)
35 self.runCmd("run", RUN_SUCCEEDED)
37 lldbutil.run_break_set_by_file_and_line(
41 num_expected_locations=-1,
44 self.expect("expr -i false -- returnsFive()", error=True,
45 substrs=['Execution was interrupted, reason: breakpoint'])
47 self.runCmd("continue", "Continue completed")
51 'stop reason = User Expression thread plan',
52 r'Completed expression: (Five) $0 = (number = 5, name = "five")'])