Handling an Exception

  1. Examine the output on the Debug tab of the Output window.

    The output in the Output window indicates where the exception occurred.

  2. Choose Go Handled from the Debug menu to let the kernel debugger handle the exception.

    The kernel debugger executes the instruction that caused the exception again.

  3. If the kernel debugger cannot handle the exception, choose Go Not Handled from the Debug menu to direct the kernel debugger to find a handler to process the exception. If an exception occurs, but choosing Go Not Handled does not cause the system to resume, choose Go.

    If the kernel debugger cannot find a handler, it tries to handle the exception. Go Not Handled terminates the process that owns the thread from which the exception is generated.

    **Note   **The kernel debugger does not contain reentrant code. If the kernel debugger is busy when an exception is raised, it blocks any user-mode threads — except kernel faults — in order to handle the exception. If the kernel debugger is busy when a kernel fault occurs, it exits. If the debugger is not busy, kernel faults are handled as usual. When the kernel debugger is no longer busy, it services the user-mode threads.

  4. Choose Debug Windows from the View menu, and then choose Call Stack.

  5. Double-click any line to display the source code corresponding to that frame.

  6. Choose Debug Windows from the View menu, and then choose Variables to view transient parts of the code, such as local variables.

    You cannot see local variables through either a Quick Watch dialog box or a Watch window.

    Note   Avoid keeping the Call Stack window open while executing code. Each time you step, the kernel debugger must evaluate the Call Stack window again.

See Also

Viewing or Modifying the List of Exceptions

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.