diff options
author | Roy Shi <royitaqi@users.noreply.github.com> | 2025-09-10 08:21:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-10 08:21:12 -0700 |
commit | acb38c8be7152aa26e6958752499619eeeeddd1c (patch) | |
tree | 56861a0486f0d35871a61b0e4681346eb6802f94 /lldb/packages/Python/lldbsuite/test | |
parent | 7d3672747b1cd07512b0f17d107253960fceaef5 (diff) | |
download | llvm-acb38c8be7152aa26e6958752499619eeeeddd1c.zip llvm-acb38c8be7152aa26e6958752499619eeeeddd1c.tar.gz llvm-acb38c8be7152aa26e6958752499619eeeeddd1c.tar.bz2 |
[lldb-dap] Add command line option `--connection-timeout` (#156803)
# Usage
This is an optional new command line option to use with `--connection`.
```
--connection-timeout <timeout> When using --connection, the number of seconds to
wait for new connections after the server has started and after all clients
have disconnected. Each new connection will reset the timeout. When the
timeout is reached, the server will be closed and the process will exit.
Not specifying this argument or specifying non-positive values will cause
the server to wait for new connections indefinitely.
```
A corresponding extension setting `Connection Timeout` is added to the
`lldb-dap` VS Code extension.
# Benefits
Automatic release of resources when lldb-dap is no longer being used
(e.g. release memory used by module cache).
# Test
See PR.
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py | 5 |
1 files changed, 5 insertions, 0 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 66aa070..51debcf 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 @@ -1533,6 +1533,7 @@ class DebugAdapterServer(DebugCommunication): env: Optional[dict[str, str]] = None, log_file: Optional[TextIO] = None, connection: Optional[str] = None, + connection_timeout: Optional[int] = None, additional_args: list[str] = [], ) -> tuple[subprocess.Popen, Optional[str]]: adapter_env = os.environ.copy() @@ -1550,6 +1551,10 @@ class DebugAdapterServer(DebugCommunication): args.append("--connection") args.append(connection) + if connection_timeout is not None: + args.append("--connection-timeout") + args.append(str(connection_timeout)) + process = subprocess.Popen( args, stdin=subprocess.PIPE, |