I'm trying to debug a Rust library in Visual Studio Code and I'm running into an issue. When I run the debug, all the breakpoints turn grey and when I hover over them they show Locations: 0
(Picture of the problem here). The tests then execute without hitting any of the breakpoints. It debugs fine when I run lldb in the terminal, and I can't reproduce the issue with other libraries, it seems to be specific to this project. I've tried copying only the required files to a new project and the issue reappears, so I think it must be something to do with my configuration.
I'm using the launch.json file created automatically by vscode:
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'my_project'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=my_project"
],
"filter": {
"name": "my_project",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
I have tests in most of the library files and the included binary, and they all have the same issue. Here's a simplified version of the project structure:
main project directory
├── benches
│ └── my_benchmark.rs
├── Cargo.lock
├── Cargo.toml
├── src
│ ├── bin
│ │ └── main.rs
│ ├── lib.rs
│ ├── requests
│ │ └── [several library files]
│ ├── requests.rs
│ ├── structures
│ │ └── [several library files]
│ └── structures.rs
The software versions I'm using are:
I looked for quite a while but I couldn't find any other mentions of this issue in other questions. Thanks for your help, please let me know if I can provide more information!
Well, I figured it out. The problem seems to be a bug in CodeLLDB version 1.6.2. I reverted to 1.6.1 and everything works fine. Leaving this up in case anyone else runs into the same issue.