pico-setup-windows icon indicating copy to clipboard operation
pico-setup-windows copied to clipboard

GDB Error 1 in Visual Studio Code on Windows

Open progvault opened this issue 1 year ago • 5 comments

Clicking the bottom debug icon in Visual Studio Code produces an error:

[proc] Executing command: "C:/Program Files/Raspberry Pi/Pico SDK v1.5.1/gcc-arm-none-eabi/bin/arm-none-eabi-gdb.exe" --version
[proc] The command: "C:/Program Files/Raspberry Pi/Pico SDK v1.5.1/gcc-arm-none-eabi/bin/arm-none-eabi-gdb.exe" --version exited with code: 1
[proc] Executing command: gdb --version
[proc] The command: gdb --version exited with code: 1

Are the forward slashes correct?

progvault avatar Dec 22 '23 21:12 progvault

The forward slashes are correct, but you need to use the configured profile for debugging, so the debug button on the bottom bar does not work. Our VS Code configuration hides that button, did you follow the steps in the tutorial to set that up and start debugging?

ndabas avatar Dec 22 '23 21:12 ndabas

The VS Code configuration (i.e. .vscode folder) was supplied with the SDK and installed by pico-setup-windows-x64-standalone.exe.

A zip file named pico-examples.zip contained the .vscode folder.

I should note that there was a step in the SDK installation process that failed. I attempted to install the examples to the C:\Program Files folder instead of the C:\Users\ Documents directory. The installer failed to extract the examples from github due to permissions error. So I used the zip file contained in the SDK.

Perhaps I need to grab the latest examples from github. I will report back.

progvault avatar Dec 22 '23 22:12 progvault

I reinstalled. Looks like the SDK installer does the same thing I did manually which was unzip pico-examples.zip to the documents directory.

I'm using the .vscode folder that was supplied with the installer and SDK.

Are you saying the small debug icon should not be in the taskbar? image

Here is the error that shows up image

Here is the command that failed

[proc] Executing command: "C:/Program Files/Raspberry Pi/Pico SDK v1.5.1/gcc-arm-none-eabi/bin/arm-none-eabi-gdb.exe" --version
[proc] The command: "C:/Program Files/Raspberry Pi/Pico SDK v1.5.1/gcc-arm-none-eabi/bin/arm-none-eabi-gdb.exe" --version exited with code: 1
[proc] Executing command: gdb --version
[proc] The command: gdb --version exited with code: 1

This command ran successfully. [proc] Executing command: "C:\Program Files\Raspberry Pi\Pico SDK v1.5.1\cmake\bin\cmake.EXE" [build] Build finished with exit code 0

That's why I thought the slashes were backwards.

This executable C:/Program Files/Raspberry Pi/Pico SDK v1.5.1/gcc-arm-none-eabi/bin/arm-none-eabi-gdb.exe for sure exists on the system.

How does that path get created?

progvault avatar Dec 22 '23 22:12 progvault

I've come to the conclusion that CMake is a mess. Sure it works however debugging issues like this is a nightmare. There is so much cache and crap left behind that pin-pointing the root cause of an issue is pretty much impossible. Even resetting and clearing doesn't get rid of everything.

It's not surprising people have so many issues and confusion.

progvault avatar Dec 23 '23 23:12 progvault

Yes, you're not supposed to use the debug button on the bottom status bar, the .vscode configuration that we provide is supposed to hide that for this reason. I'll see if I can replicate this behavior.

The recommended way to start debugging is documented in the tutorial (which is included and installed as readme.txt if you use this installer.)

There is plenty of discussion in the cmake-tools VS Code extension repo around this, for example: https://github.com/microsoft/vscode-cmake-tools/discussions/3188

ndabas avatar Dec 24 '23 11:12 ndabas