Rust debugging - not hitting any breakpoints in visual studio code

Viewed 288

I am trying to look at some breakpoints in code. I installed rust-analyzer, codelldb, and native debug plugins for code and generated the default launch.json. It seems like the debugger is not attaching properly to the process and runs right through the breakpoints. It's probably something simple that's going wrong - here's my launch.json:

{
    // 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 'thedrewreport'",
            "cargo": {
                "args": [
                    "test",
                    "--no-run",
                    "--lib",
                    "--package=thedrewreport"
                ],
                "filter": {
                    "name": "thedrewreport",
                    "kind": "lib"
                }
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        },
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug executable 'thedrewreport'",
            "cargo": {
                "args": [
                    "build",
                    "--bin=thedrewreport",
                    "--package=thedrewreport"
                ],
                "filter": {
                    "name": "thedrewreport",
                    "kind": "bin"
                }
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        },
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug unit tests in executable 'thedrewreport'",
            "cargo": {
                "args": [
                    "test",
                    "--no-run",
                    "--bin=thedrewreport",
                    "--package=thedrewreport"
                ],
                "filter": {
                    "name": "thedrewreport",
                    "kind": "bin"
                }
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        }
    ]
}

Here's a video of the debugger in action and a pic of the plugins installed.

Any ideas?

1 Answers

Try to remove the target floder, than press F5 to auto build and debug. It's maybe because you build from console, but build without debug info.

Related