
gdb调试fork出来的子进程,通过设置
`set follow-fork-mode MODE'
Set the debugger response to a program call of `fork' or `vfork'.
A call to `fork' or `vfork' creates a new process. The MODE can
be:
`parent'
The original process is debugged after a fork. The child
process runs unimpeded. This is the default.
`child'
The new process is debugged after a fork. The parent process
runs unimpeded.
`ask'
The debugger will ask for one of the above choices.
`show follow-fork-mode'
Display the current debugger response to a `fork' or `vfork' call.