Breaking On Exit

Related Topics:

Setting Custom Breakpoint Actions Setting Up a Trace
Breakpoints Window Breakpoint Types

You can set an On Exit breakpoint to trace program execution or to apply special actions when your program exits with the specified code. You cannot set an On Exit breakpoint when Action is set to Stop.

To set an On Exit breakpoint:

1. In the Debugging Window, choose Windows Breakpoints or Execute Set Breakpoints.

2. If the Details pane of the Breakpoints window is not displayed, click the Add/Change Breakpoint button (the Add/Change Breakpoint window toggles to Hide Details).

3. Choose Action CUSTOM and type the action to be taken in the Action text box.

4. Choose Event On Exit.

Or, type the exit code.

If you do not type an exit code, the event triggers when the process exits with any exit code.

5. Click Add.