One Quickie


Lie in wait for a launching process (gdb->General)
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 blah
Now when a blah process launches, gdb will stop it and attach to it.



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com