aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorWalter Erquinigo <a20012251@gmail.com>2023-10-25 00:05:54 -0400
committerGitHub <noreply@github.com>2023-10-25 00:05:54 -0400
commit10664813fca8d5ccbfd90bae9e791b7062dabd7c (patch)
treeb16222307bff41fba748ff041f6f01794b29c072 /lldb/packages/Python/lldbsuite/test
parentd72aa10a9a08e8213c84060de5a78bfb2fc1a6e5 (diff)
downloadllvm-10664813fca8d5ccbfd90bae9e791b7062dabd7c.zip
llvm-10664813fca8d5ccbfd90bae9e791b7062dabd7c.tar.gz
llvm-10664813fca8d5ccbfd90bae9e791b7062dabd7c.tar.bz2
[lldb-vscode] Allow specifying a custom escape prefix for LLDB commands (#69238)
We've been using the backtick as our escape character, however that leads to a weird experience on VS Code, because on most hosts, as soon as you type the backtick on VS Code, the IDE will introduce another backtick. As changing the default escape character might be out of question because other plugins might rely on it, we can instead introduce an option to change this variable upon lldb-vscode initialization. FWIW, my users will be using : instead ot the backtick.
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py9
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py4
2 files changed, 12 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
index 8c645e0..d1fb478 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
@@ -731,6 +731,7 @@ class DebugCommunication(object):
postRunCommands=None,
enableAutoVariableSummaries=False,
enableSyntheticChildDebugging=False,
+ commandEscapePrefix="`",
):
args_dict = {"program": program}
if args:
@@ -774,6 +775,7 @@ class DebugCommunication(object):
args_dict["postRunCommands"] = postRunCommands
args_dict["enableAutoVariableSummaries"] = enableAutoVariableSummaries
args_dict["enableSyntheticChildDebugging"] = enableSyntheticChildDebugging
+ args_dict["commandEscapePrefix"] = commandEscapePrefix
command_dict = {"command": "launch", "type": "request", "arguments": args_dict}
response = self.send_recv(command_dict)
@@ -1015,7 +1017,12 @@ class DebugCommunication(object):
class DebugAdaptorServer(DebugCommunication):
def __init__(
- self, executable=None, port=None, init_commands=[], log_file=None, env=None
+ self,
+ executable=None,
+ port=None,
+ init_commands=[],
+ log_file=None,
+ env=None,
):
self.process = None
if executable is not None:
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
index 3094b66..aa89ffe 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
@@ -351,6 +351,7 @@ class DAPTestCaseBase(TestBase):
postRunCommands=None,
enableAutoVariableSummaries=False,
enableSyntheticChildDebugging=False,
+ commandEscapePrefix="`",
):
"""Sending launch request to dap"""
@@ -389,6 +390,7 @@ class DAPTestCaseBase(TestBase):
postRunCommands=postRunCommands,
enableAutoVariableSummaries=enableAutoVariableSummaries,
enableSyntheticChildDebugging=enableSyntheticChildDebugging,
+ commandEscapePrefix=commandEscapePrefix,
)
if expectFailure:
@@ -425,6 +427,7 @@ class DAPTestCaseBase(TestBase):
lldbDAPEnv=None,
enableAutoVariableSummaries=False,
enableSyntheticChildDebugging=False,
+ commandEscapePrefix="`",
):
"""Build the default Makefile target, create the DAP debug adaptor,
and launch the process.
@@ -455,4 +458,5 @@ class DAPTestCaseBase(TestBase):
postRunCommands=postRunCommands,
enableAutoVariableSummaries=enableAutoVariableSummaries,
enableSyntheticChildDebugging=enableSyntheticChildDebugging,
+ commandEscapePrefix=commandEscapePrefix,
)