Yes because PlatformIO supports a simulator program (simavr
) and avr-stub
, which runs a GDB server on the device if you include a special library and a piece of code.
Please further fully read the documentation of each debugging tool that is stated there.
If you want to use the simulator, as per linked docs, add debug_tool = simavr
. Otherwise follow the tutorial for avr-stub
as linked per docs.
There’s also an example setup at How to debug on Arduino mega 2560 - #2 by maxgerhardt.