Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run in terminal fails with lldb-dap timeout #1354

Open
timsneath opened this issue Jan 31, 2025 · 3 comments
Open

Run in terminal fails with lldb-dap timeout #1354

timsneath opened this issue Jan 31, 2025 · 3 comments
Labels
bug Something isn't working question Further information is requested

Comments

@timsneath
Copy link
Contributor

Describe the bug
I'm working on an interactive command line app using Swift, and because it uses raw mode ANSI VT commands it needs to run in an external terminal rather the built-in VSCode terminal.

Adding the "runInTerminal": true entry to launch.json should enable this, but when running a debug session, it times out with an error message:

Timed out trying to get messages from the debug adaptor

To Reproduce
Steps to reproduce the behavior:

  1. Create a console app
  2. Set a breakpoint
  3. Add the "runInTerminal": true entry to launch.json to set a debug configuration that uses the system terminal.
  4. Start debug in VSCode
  5. Error:
Image

Command line in terminal shows as:

cd /Users/timsneath/src/kilo-swift ; /usr/bin/env /Applications/Xcode.app/Contents/Developer/usr/bin/lldb-dap --comm-file /var/folders/0_/gnsdt09d1j131m349083j4f40000gn/T/lldb-dap-run-in-terminal-comm-4afc92 --debugger-pid 76637 
--launch-target /Users/timsneath/src/kilo-swift/.build/debug/kilo 

Expected behavior
A clear and concise description of what you expected to happen.

Environment

  • OS: macOS Sequoia 15.3
  • Swift version (output of swift --version)

swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx15.0

  • Visual Studio Code version: Version: 1.96.4 (Universal)
  • vscode-swift version: 1.11.4

Additional context
Full launch.json:

{
    "configurations": [
        {
            "type": "swift-lldb",
            "request": "launch",
            "args": [],
            "runInTerminal": true,
            "cwd": "${workspaceFolder:kilo-swift}",
            "name": "Debug kilo",
            "program": "${workspaceFolder:kilo-swift}/.build/debug/kilo",
            "preLaunchTask": "swift: Build Debug kilo",
        },
        {
            "type": "swift-lldb",
            "request": "launch",
            "args": [],
            "cwd": "${workspaceFolder:kilo-swift}",
            "name": "Release kilo",
            "program": "${workspaceFolder:kilo-swift}/.build/release/kilo",
            "preLaunchTask": "swift: Build Release kilo"
        }
    ]
}
@plemarquand
Copy link
Contributor

I had a go at reproducing this but I couldn't reproduce the issue. From VS Code, with your project open, could you run > Swift: Capture VS Code Diagnostic Bundle and choose Capture Minimal Diagnostics, and then zip/attach the resulting files here? This should give us a more complete picture of how you have your project configured and what your VS Code settings are.

@award999 award999 added the question Further information is requested label Feb 5, 2025
@award999
Copy link
Contributor

award999 commented Feb 5, 2025

Is the swift.debugger.useDebugAdapterFromToolchain setting enabled?

@timsneath
Copy link
Contributor Author

@award999 Yes, that was enabled. Turning it off got the breakpoint to hit.

We should support this, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
Development

No branches or pull requests

3 participants