TotalView User Guide : Part V: Debugging : Setting Action Points : Setting Breakpoints and Barriers : Setting Breakpoints When Using the fork()/execve() Functions : Example: Multi-process Breakpoint

Example: Multi-process Breakpoint
The following program excerpt illustrates the places where you can set breakpoints in a multi-process program:
1 pid = fork();
2 if (pid == 1)
3 error ("fork failed");
4 else if (pid == 0)
5 children_play();
6 else
7 parents_work();
The following table describes what happens when you set a breakpoint at different places:
 
Stops the parent process if the fork() function failed.

Rogue Wave Software, Inc.
Voice: (303) 473-9118
rwonlinedocs@roguewave.com