raspberrypi/openocd

GDB error when debugging PIO projects on VSCode

tswan22 opened this issue · 1 comments

OS: Ubuntu 22.04

Debug Setup: picoprobe, openocd, gdb-multiarch, arm-none-eabi, VSCode (Cortex-Debug, Cmake Tools, also see my settings.json and launch.json)

Description: I am able to program and debug pico programs using my setup without issues except when the program contains code related to PIO. Take the hello_pio example project, if I start debugging (F5) the pico is programmed and debugging starts, but if I am in the "Run and Debug" view (Ctrl + Shift + D) the VARIABLES>Locals section attempts to load and then cancels, followed by the debug ending. Here are the DEBUG_CONSOLE and TERMINAL outputs.
Something interesting I noted is that if VSCode is not in the "Run and Debug" view, I am able to step through the program without problems, but if I attempt to look at "Run and Debug" view before finishing line 28 of hello_pio: hello.c, the error occurs. If I look at "Run and Debug" after line 28, I am able to debug as expected.
Any ideas on how to resolve this?

Edit: After testing a few more things it seems like the issue may be related to debugging variables that have been optimized out or do not exist yet, it may not be PIO at all.

Note: I was not certain if this should be posted here, on picoprobe GitHub, or somewhere else, so please let me know