1 """Test variable lookup when stopped in inline functions."""
5 from lldbsuite
.test
.decorators
import *
6 from lldbsuite
.test
.lldbtest
import *
7 from lldbsuite
.test
import lldbutil
10 class InlinesTestCase(TestBase
):
12 # Call super's setUp().
14 # Find the line number to break inside main().
15 self
.line
= line_number("inlines.cpp", "// Set break point at this line.")
18 """Test that local variables are visible in expressions."""
20 self
.runToBreakpoint()
22 # Check that 'frame variable' finds a variable
24 "frame variable inner_input",
25 VARIABLES_DISPLAYED_CORRECTLY
,
26 startstr
="(int) inner_input =",
29 # Check that 'expr' finds a variable
31 "expr inner_input", VARIABLES_DISPLAYED_CORRECTLY
, startstr
="(int) $0 ="
34 def runToBreakpoint(self
):
35 exe
= self
.getBuildArtifact("a.out")
36 self
.runCmd("file " + exe
, CURRENT_EXECUTABLE_SET
)
38 # Break inside the main.
39 lldbutil
.run_break_set_by_file_and_line(
40 self
, "inlines.cpp", self
.line
, num_expected_locations
=2, loc_exact
=True
43 self
.runCmd("run", RUN_SUCCEEDED
)
45 # The stop reason of the thread should be breakpoint.
48 STOPPED_DUE_TO_BREAKPOINT
,
49 substrs
=["stopped", "stop reason = breakpoint"],
52 # The breakpoint should have a hit count of 1.
53 lldbutil
.check_breakpoint(self
, bpno
=1, expected_hit_count
=1)