Setting Which Process to Follow After a Fork

Related Topics:

Fork and Thread Defaults

By default, the parent process is followed after a fork. You can choose a different default for a forked process.

To set the default for a forked process:

1. In the Debugging Window, choose Debug Debugging Options. Or, from the WorkShop main window, choose Options Debugging Options.

2. In the Debugging Options Dialog Box, click the Forks and Threads tab.

3. Click the appropriate radio button:
Parent The fork is ignored and the parent is followed. This is the default behavior.
Child Debugging switches to the forked child. The process id of the current process changes to the child's process id. The parent continues as if it had been detached, and the child process is suspended as if it had been attached. Use Go or Step Into to execute the child process.
Both A second debugging session is launched to debug the child process, and becomes the current session. The parent's debugging session remains as an active process. The child process is suspended as if it had been attached.
Ask User Whenever a fork is detected, the Follow Fork Dialog Box displays, allowing you to choose between the parent, the child, or both processes at the same time. You can examine the state of your program each time to see which fork you want to follow.

4. Click OK to apply your choices to the current session, or click Save as Defaults and then click OK to use them as the new defaults.

The selected action occurs whenever the process executes fork().


Note - This option is equivalent to the dbx
follow_fork_inherit Environment Variable.