summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
diff options
context:
space:
mode:
authorAlex Langford <apl@fb.com>2019-08-19 20:17:27 +0000
committerAlex Langford <apl@fb.com>2019-08-19 20:17:27 +0000
commit3b4ce731fbcc6490da95d8091b384c3ddb3c70d9 (patch)
treeb01c73ff4c875a906d35d6aa4891b8f5df3f45ed /lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
parent928071ae4ef5e2e6342afb126518a79fde81cf8b (diff)
downloadbcm5719-llvm-3b4ce731fbcc6490da95d8091b384c3ddb3c70d9.tar.gz
bcm5719-llvm-3b4ce731fbcc6490da95d8091b384c3ddb3c70d9.zip
[lldb-vscode] add `launchCommands` to handle launch specific commands
Summary: This can help `lldb-vscode` handle launch commands associate with remote platform attach request have field `attachCommands` to handle attach specific commands add a corresponding one for launch request if no launch command is provided, create a new target and launch; otherwise, execute the launch command Differential Revision: https://reviews.llvm.org/D65363 Patch by Wanyi Ye <kusmour@gmail.com> llvm-svn: 369296
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py41
1 files changed, 28 insertions, 13 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
index 662a0570871..cff85346de5 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
@@ -245,20 +245,17 @@ class VSCodeTestCaseBase(TestBase):
self.assertTrue(response['success'],
'attach failed (%s)' % (response['message']))
- def build_and_launch(self, program, args=None, cwd=None, env=None,
- stopOnEntry=False, disableASLR=True,
- disableSTDIO=False, shellExpandArguments=False,
- trace=False, initCommands=None, preRunCommands=None,
- stopCommands=None, exitCommands=None,
- sourcePath=None, debuggerRoot=None):
- '''Build the default Makefile target, create the VSCode debug adaptor,
- and launch the process.
+ def launch(self, program=None, args=None, cwd=None, env=None,
+ stopOnEntry=False, disableASLR=True,
+ disableSTDIO=False, shellExpandArguments=False,
+ trace=False, initCommands=None, preRunCommands=None,
+ stopCommands=None, exitCommands=None,sourcePath= None,
+ debuggerRoot=None, launchCommands=None):
+ '''Sending launch request to vscode
'''
- self.build_and_create_debug_adaptor()
- self.assertTrue(os.path.exists(program), 'executable must exist')
- # Make sure we disconnect and terminate the VSCode debug adaptor even
- # if we throw an exception during the test case.
+ # Make sure we disconnet and terminate the VSCode debug adaptor,
+ # if we throw an exception during the test case
def cleanup():
self.vscode.request_disconnect(terminateDebuggee=True)
self.vscode.terminate()
@@ -283,7 +280,25 @@ class VSCodeTestCaseBase(TestBase):
stopCommands=stopCommands,
exitCommands=exitCommands,
sourcePath=sourcePath,
- debuggerRoot=debuggerRoot)
+ debuggerRoot=debuggerRoot,
+ launchCommands=launchCommands)
if not (response and response['success']):
self.assertTrue(response['success'],
'launch failed (%s)' % (response['message']))
+
+ def build_and_launch(self, program, args=None, cwd=None, env=None,
+ stopOnEntry=False, disableASLR=True,
+ disableSTDIO=False, shellExpandArguments=False,
+ trace=False, initCommands=None, preRunCommands=None,
+ stopCommands=None, exitCommands=None,
+ sourcePath=None, debuggerRoot=None):
+ '''Build the default Makefile target, create the VSCode debug adaptor,
+ and launch the process.
+ '''
+ self.build_and_create_debug_adaptor()
+ self.assertTrue(os.path.exists(program), 'executable must exist')
+
+ self.launch(program, args, cwd, env, stopOnEntry, disableASLR,
+ disableSTDIO, shellExpandArguments, trace,
+ initCommands, preRunCommands, stopCommands, exitCommands,
+ sourcePath, debuggerRoot)
OpenPOWER on IntegriCloud