probe-rs / vscode

VSCode debug extension for probe-rs. It uses the MS DAP protocol to communicate directly with the probe (via probe-rs), and supports basic command line debugging in addition to VSCode UI.
https://probe.rs/
Other
65 stars 5 forks source link

Debugging session ends with no error message #57

Closed uzytkownik closed 1 year ago

uzytkownik commented 1 year ago

I tried to set up debugging session:

{
    // 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": "probe-rs-debug",
            "request": "launch",
            "name": "probe-rs Test",
            "cwd": "${workspaceFolder}",
            "connectUnderReset": true,
            "chip": "RP2040",
            "flashingConfig": {
                "flashingEnabled": true,
                "resetAfterFlashing": true,
                "haltAfterReset": true
            },
            "coreConfigs": [
                {
                    "coreIndex": 0,
                    "programBinary": "./target/thumbv7em-none-eabihf/debug/${workspaceFolderBasename}"
                }
            ]
        },
    ]
}

However when I try to launch it, the session ends immediately without displaying any error or anything like that. probe-rs-cli gdb --chip RP2040 --protocol swd works.

Yatekii commented 1 year ago

Do you have the probe-rs-debugger installed?

noppej commented 1 year ago

In theory, you should get this message if you don't have the debugger installed. Screenshot 2023-03-30 at 9 00 55 AM

So I'm guessing you are running into some other environmental issue relating to launching. Can you please provide the following info to help with the trouble shooting?

uzytkownik commented 1 year ago

From the terminal window in VSCode session, `probe-rs-debugger --version

$ probe-rs-debugger --version
probe-rs-debugger 0.16.0

From VSCode extension viewer, the version of the probe-rs-debug extension

0.17.4

What happens if you run with connectUnderReset : false

Nothing. It looks as if it is about to run something than it ends.

Your OS type and version

NixOS unstable

After you get this issue, are there any probe-rs-debugger processes hanging around in the background of your OS?

No

noppej commented 1 year ago

Thank you. Can you please install the latest version from github and try again? cargo install --force --git https://github.com/probe-rs/probe-rs --branch master probe-rs-debugger

noppej commented 1 year ago

Update: We've just released 0.18.0 to crates.io, so you can install with cargo install probe-rs-debugger

uzytkownik commented 1 year ago

Now it displays error "cancelled"

noppej commented 1 year ago

Thanks. This is unusual, so please be patient as I diagnose. The "cancelled" output suggests that the extension is having difficulty spawning the probe-rs-debugger process. We test for errors, but obviously something is going wrong in a way that we have not encountered / programmed for before.

Two more suggestions for you to try: 1) Do you have a different (than NixOS) operating system to try? 2) Let's try to get you running by manually starting the probe-rs-debugger process.

uzytkownik commented 1 year ago

I was invalid program. I specified path as thumbv7em-none-eabihf instead of thumbv6m-none-eabi:

ERROR probe_rs_debugger::server::startup: probe-rs-debugger session ended: Other(Invalid program binary file specified '..././target/thumbv7em-none-eabihf/debug/..."')

It sounds like an error that should be bubbled up to the user.

noppej commented 1 year ago

Definitely! Thanks for helping to identify the cause.

noppej commented 1 year ago

Fixed by https://github.com/probe-rs/probe-rs/pull/1581

To get access to this prior to the post 0.18.0 release, please install from github:

cargo install --force --git https://github.com/probe-rs/probe-rs --branch master probe-rs-debugger