Ran across this the other day and thought it might be useful for the community.
Someone has ported the Black Magic Probe firmware to ESP32, providing a remote
gdb interface for Cortex-A and Cortex-M (like the SAM3X8 in the M2…) processors.
I haven’t had a chance to actually dive into it yet but it shows to promise.
The README focuses on some ST and RAK MCUs but the original firmware it’s based on does support the SAM3X8, unsure if there is still porting to be done though.