Oracle® Solaris Studio 12.4: Debugging a Program With dbx

Exit Print View

Updated: January 2015
 
 

Exception Handling in dbx

A program stops running if an exception occurs. Exceptions signal programming anomalies, such as division-by-zero or array overflow. You can set up blocks to catch exceptions raised by expressions elsewhere in the code.

    While debugging a program, dbx enables you to do the following:

  • Catch unhandled exceptions before stack unwinding

  • Catch unexpected exceptions

  • Catch specific exceptions regardless of whether they are handled before stack unwinding

  • Determine where a specific exception would be caught if it occurred at a particular point in the program

If you issue a step command after stopping at a point where an exception is thrown, control is returned at the start of the first destructor executed during stack unwinding. If you step out of a destructor executed during stack unwinding, control is returned at the start of the next destructor. When all destructors have been executed, a step command brings you to the catch block handling the throwing of the exception.