Partager via


Handle Exceptions (Compact 7)

3/12/2014

When an exception occurs, the debugger writes an exception message to the Platform Builder Output window. Alternatively, the debugger can break execution of the program when an exception occurs, giving you a chance to debug it. You can manage and handle exceptions based on their type. To configure how exceptions are handled, see Configure Exception Handling.

The following procedures show you how you can handle an exception and how to continue execution after an exception.

To handle an exception

  1. When an exception occurs, examine the results on the Output tab of the Platform Builder Output window. The results in the Output window indicate where the exception occurred.

  2. If Platform Builder displays a dialog box that contains a summary of the exception, examine this information, and then click OK.

  3. On the Platform Builder Debug menu, click Windows, and then click Call Stack. Double-click any line to display the source code corresponding to that frame.

  4. On the Debug menu, click Windows, and then click Autos to view transient parts of the code, such as local variables.

To continue execution after an exception

  1. In Platform Builder, click Debug, and then click Start.

  2. If Platform Builder displays a message that asks if you want to pass the exception on to the program being debugged, click Yes to pass the exception to the program being debugged, No to pass the exception back to the kernel, or Cancel to simply leave the execution halted at the line of code that caused the exception.

See Also

Concepts

Kernel Debugger
Debugging

Other Resources

Windows Embedded Compact 7