How does one automatically attach a debugger to a process at process start on OS X?
问题 I have a process that spawns a helper process. Sometimes I need to debug start-up failures in the second process. On Windows, I would use Image File Execution Options , or ntsd -o . However, I have no idea how to do this with gdb on OS X. 回答1: Use gdb --wait. For example, try gdb --wait TextEdit from the command line, then launch TextEdit. 回答2: I don't think that you can have gdb launch in the same manner. Instead, run your parent process from within gdb or attach to the running process