Search code examples
cprocessgdb

Meaning of "Detaching after fork from child process 15***"?


What does it mean when GDB outputs the message above?

Detaching after fork from child process 15***


Solution

  • When GDB is debugging a particular process, and the process forks off a child process, GDB can only follow one of the two processes, so it must detach (stop following) the other. This line informs you of this selective detachment. The child process will run without being debugged by GDB.

    You can select which process to follow using the set follow-fork-mode command. Use set follow-fork-mode child to follow child processes, and set follow-fork-mode parent to return to the default behavior. For more details, see this page on the Apple development website.