I am running a server that fork()'s off processes upon new connections in a loop. However, somewhere in the child section of the program there are errors.
I am trying to use gdb to find the problem, but having difficulty having gdb follow the child process. In particular, to do so, I set a break-point before the fork(). Before the fork executes, gdb returns me to the command prompt. I then enter "set fork-follow-mode" to follow a child process through. Once the child terminates, I would expect one of two things:
A) The parent process is executed from where it left off at the break
B) gdb returns me back to the command prompt, but this time to the parent process.
At the least, I would expect gdb to break once again when it reaches the fork() where the break was set.
Instead, the program executes as if the break was not there, and spawns several new child processes. Why is that? Shouldn't the parent stop at the break again?