My app runs fine but gdb fails to debug it with the following error
(gdb) run
Starting program: /path/to/app
Unable to find Mach task port for process-id 83
This link had the clearest and most detailed step-by-step to make this error disappear for me.
In my case I had to have the key as a "System" key otherwise it did not work (which not every url mentions).
Also killing taskgated
is a viable (and quicker) alternative to having to restart.
I also uninstalled MacPorts before I started this process and uninstalled the current gdb using brew uninstall gdb
.