Sorry for a trivial question, but googling leads me to trivial first-time walk-throughs of VS Code.
A year ago, I tried VS Code and probably CodeLLVM debugger, and did debug some simple crate (with code in main.rs
) with breakpoints.
Now I've installed VS Code again and am completely lost.
I have a project with couple of binaries and want to debug one, step by step. Extensions I've got: 1. Rust analyzer, 2. CodeLLVM, 3. cargo and 4. crates.
Made an automatic configuration json file via some menu (see below), and it made tests as the first configuration. I want to run the 4th configuration, but can't see how. The only thing it always runs is the first config, which simply does cargo test
.
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'route'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=route"
],
"filter": {
"name": "route",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'astar'",
"cargo": {
"args": [
"build",
"--bin=astar",
"--package=route"
],
"filter": {
"name": "astar",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'astar'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=astar",
"--package=route"
],
"filter": {
"name": "astar",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
// tihs is what I want to run
// equivalent of `cargo r --bin alt ../data/ala/bus.csv`
"type": "lldb",
"request": "launch",
"name": "Debug executable 'alt'",
"cargo": {
"args": [
"build",
"--bin=alt",
"--package=route",
"../data/ala/bus.csv"
],
"filter": {
"name": "alt",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'alt'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=alt",
"--package=route"
],
"filter": {
"name": "alt",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
]
}