Can not see any global variables when debugging in VSCode (atmelavr/uno)



platform = atmelavr

board = uno

framework = arduino

debug_tool = avr-stub

debug_port = COM3

build_unflags = -Os

build_flags = -O0 -g3 -ggdb

; GDB stub implementation

lib_deps =

    jdolinay/avr-debugger @ ~1.1


1 Like

Remove these lines and set build_type = debug in the platformio.ini. Then retry.

If that does still not work, go into the “debug console” and do a

p lastAnalogRead

does it give information on the variable?

The removing of the flags and unflags and replacing them with build_type didn’t work.
Here is the output of lastAnalogRead

$1 = 0


Reproducable, and reported to Global variables are not shown for AVR + avr-stub · Issue #2334 · platformio/platformio-vscode-ide · GitHub and will be discussed there (CC @ivankravets).

1 Like

Thank you! You have hearth in the issue from me :slight_smile: