diff --git a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py --- a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py +++ b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py @@ -11,6 +11,7 @@ import lldb from .lldbtest import * from . import lldbutil +from lldbsuite.test import configuration if sys.platform.startswith('win32'): # llvm.org/pr22274: need a pexpect replacement for windows @@ -33,8 +34,6 @@ args = ['--no-lldbinit', '--no-use-colors'] for cmd in self.setUpCommands(): args += ['-O', cmd] - if executable is not None: - args += ['--file', executable] if extra_args is not None: args.extend(extra_args) self.child = pexpect.spawn( @@ -44,8 +43,23 @@ for cmd in self.setUpCommands(): self.child.expect_exact(cmd) self.expect_prompt() + + if configuration.lldb_platform_name: + self.child.sendline("platform select " + configuration.lldb_platform_name) + self.child.expect_exact("Platform: " + configuration.lldb_platform_name) + self.expect_prompt() + self.child.sendline("platform connect " + configuration.lldb_platform_url) + self.child.expect_exact("Connected: yes") + self.expect_prompt() + + if configuration.lldb_platform_working_dir: + self.child.sendline("platform mkdir " + configuration.lldb_platform_working_dir) + self.expect_prompt() + self.child.sendline("platform settings -w " + configuration.lldb_platform_working_dir) + self.expect_prompt() + if executable is not None: - self.child.expect_exact("target create") + self.child.sendline("target create " + executable) self.child.expect_exact("Current executable set to") self.expect_prompt()