Handle Signals for User-Defined Exceptions

If you want to debug your own C++ exception-handling code, you can enable signal handling for user-defined exceptions, so that whenever an exception is thrown, execution stops before your code handles the exception. Follow these steps to enable signal handling for user-defined exceptions:

  1. Start debugging your program. A process workbook section appears and becomes the foreground section. Execution stops at the start of the main function.
  2. Select the Project tab for the project you are debugging.
  3. Select the Debug page of the project if it is not already the foreground page.
  4. In the Debuggable Processes view, expand the icon beside the process you want to debug.
  5. Expand the icon for the signals object. The first signal, EXCEPTION_THROW, is the signal for user-defined exceptions. If the octagon to its right is green, click on it to turn it red. This enables the signal for user-defined exceptions.

If your exception-handling code occurs in only a few places, you can also force execution to stop whenever an exception is thrown by setting a statement breakpoint at the start of each catch block.



Debug Exception-Handling Code
Determine Causes of System Exceptions