Can you check if this problem goes away when you use a newer avr-gcc / avr-gdb toolchain version?
Assuming you’re using Windows or Linux, you can
- download avr toolchain 14.1.0 at https://github.com/ZakKemble/avr-gcc-build/releases
- Unpack it to any folder (e.g.,
C:\Users\<user>\Desktop\new-toolchain) - copy the file
C:\Users\<user>\.platformio\packages\toolchain-atmelavr\package.jsonto the root of the unpacked folder - Modify your
platformio.inito point to your new toolchain by adding the lines
platform_packages =
toolchain-atmelavr@symlink://C:\Users\<user>\Desktop\new-toolchain
- Retry debugging