Debugging in VS Code

Hey, I have working Rust setup in VS Code but somehow when trying to debug the exercise’s code with the LLDB it doesn’t seem to work and the process quits after few seconds with the following output:

Launching: /Users/mateusz.kwiatkowski/Exercism/rust/luhn/target/debug/deps/luhn-cd9aa5759c174b02 single_digit_strings_can_not_be_valid --exact --nocapture
Launched process 24193
Process exited with code -1.

The automatically created launch.json file looks like this:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "lldb",
      "request": "launch",
      "name": "Debug unit tests in library 'luhn'",
      "cargo": {
        "args": [
          "test",
          "--no-run",
          "--lib",
          "--package=luhn"
        ],
        "filter": {
          "name": "luhn",
          "kind": "lib"
        }
      },
      "args": [],
      "cwd": "${workspaceFolder}"
    },
    {
      "type": "lldb",
      "request": "launch",
      "name": "Debug integration test 'luhn'",
      "cargo": {
        "args": [
          "test",
          "--no-run",
          "--test=luhn",
          "--package=luhn"
        ],
        "filter": {
          "name": "luhn",
          "kind": "test"
        }
      },
      "args": [],
      "cwd": "${workspaceFolder}"
    }
  ]
}

At the same time debugging with RustRover is seamlessly all the time. I couldn’t spot any obvious differences between these two, and therefore I would appreciate any help or feedback in case debugging of Exercism’s exercises is currently not possible in VS Code.

Debugging works fine for me in vscode. But I don’t even need a generated launch.json.

When installing the rust-analyzer and lldb-vscode extensions, I end up with little buttons above main function and test cases to debug these things precisely. I usually use those. I don’t know if launch.json might be preferred for some cases, but I’d say let’s try without it and see what happens.

Yeah, I also use them to run tests and debugger. But even without launch config both behaviour of debugger and output don’t change. I have also tried VSCodium and it’s the same.

Is debugging not working at all? not even with completely different projects? e.g. run cargo new and debug the hello world. or is the problem exercise / test specific?

It’s a bummer as it seems to be broken also for a simple hello world example.

EDIT: it turned out to be a Mac-related problem occuring after latest system update: Can't debug on macOS 12 beta · vadimcn/codelldb · Discussion #456 · GitHub. Deleteing delete "vadimcn.vscode-x.x.x/lldb/bin/debugserver" from .vscode/extensions fixed it.