GDB debugger for macOS Apple Silicon

GDB debugger is not yet readily available for macOS with Apple Silicon CPU. It has long been possible to use a virtual machine with Linux for ARM64 to run GDB within the VM. The CLion package provides GDB, but with caveats such as using a particular compiler and libstdc++. What happens for us is when trying to use GDB, it doesn’t work:

gdb ./myexe
r

Don’t know how to run. Try “help target”.

In general, currently to use GDB on an Apple Silicon Mac, it seems a Linux VM is the best option–hopefully this changes.