Attaching to a running process is pretty nifty, handy for debugging daemons started by launchd. But you miss all the fun stuff that happens at program launch before you you can attach to it.The
attach
command's-waitfor
option to make gdb lie in wait for a launching process:% gdb /some/app/blah (gdb) attach -waitfor blahNow when ablah
process launches, gdb will stop it and attach to it.