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
The problem is that you are not logged in as a root user (which you don't want). You need to create a certificate for gdb to be allowed access. Follow this tutorial and you should be good to go...
http://sourceware.org/gdb/wiki/BuildingOnDarwin
If all else fails, just use: sudo gdb executableFileName