debugging rust application with vscode
Please ensure you have selected your root folder (the one that contains cargo.toml) and then open this using vscode open folder.
Install CodeLLDB debugger extensions.
Set a break point and ensure you have something like this in the launch.json file.
{
// 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 executable 'tut'",
"cargo": {
"args": [
"build",
"--bin=tut",
"--package=tut"
],
"filter": {
"name": "tut",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'tut'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=tut",
"--package=tut"
],
"filter": {
"name": "tut",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
Comments