1 """Test multiline expressions."""
3 from __future__ import print_function
7 from lldbsuite.test.decorators import *
8 from lldbsuite.test.lldbtest import *
9 from lldbsuite.test import lldbutil
12 class MultilineExpressionsTestCase(TestBase):
14 mydir = TestBase.compute_mydir(__file__)
17 # Call super's setUp().
19 # Find the line number to break on inside main.cpp.
20 self.line = line_number('main.c', 'break')
25 bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
26 def test_with_run_commands(self):
27 """Test that multiline expressions work correctly"""
30 exe = os.path.join(os.getcwd(), "a.out")
33 # So that the child gets torn down after the test.
34 self.child = pexpect.spawn(
36 (lldbtest_config.lldbExec, self.lldbOption, exe))
38 # Turn on logging for what the child sends back.
40 child.logfile_read = sys.stdout
42 # Set the breakpoint, run the inferior, when it breaks, issue print on
43 # the various convenience variables.
44 child.expect_exact(prompt)
45 child.sendline('breakpoint set -f main.c -l %d' % self.line)
46 child.expect_exact(prompt)
48 child.expect_exact("stop reason = breakpoint 1.1")
49 child.expect_exact(prompt)
50 child.sendline('expr')
51 child.expect_exact('1:')
54 child.expect_exact('2:')
57 child.expect_exact('3:')
60 child.expect_exact(prompt)
61 self.expect(child.before, exe=False,