Get a Machine-State Dump

If a process ends because of an unhandled or incorrectly handled exception, a message gives you the address at which the exception occurred. Usually this information alone is not enough to determine the problem.

To get a machine-state dump when an unhandled exception occurs, build the application with the /Tx+ compiler option. The dump consists of a number of run-time messages that show information about the state of the system, such as the contents of the registers and the reason for the exception. This information is sent to file handle 2, which is usually associated with stderr. Call the _set_crt_msg_handle function to redirect the messages to a file.

You can use the IBM C and C++ Compilers debugger to identify where in your source the exception took place.



Signals and Exceptions


Step Through Your Program with the Debugger


Example of an OS/2 Machine-State Dump
Example of a Windows Machine-State Dump