Share via


ICorDebugManagedCallback2::Exception Method

Notifies the debugger that a search for an exception handler has started.

HRESULT Exception (
    [in] ICorDebugAppDomain   *pAppDomain,
    [in] ICorDebugThread      *pThread,
    [in] ICorDebugFrame       *pFrame,
    [in] ULONG32              nOffset,
    [in] CorDebugExceptionCallbackType dwEventType,
    [in] DWORD                dwFlags
);

Parameters

Parameter Description

pAppDomain

[in] A pointer to an ICorDebugAppDomain Interface object that represents the application domain containing the thread on which the exception was thrown.

pThread

[in] A pointer to an ICorDebugThread Interface object that represents the thread on which the exception was thrown.

pFrame

[in] A pointer to an ICorDebugFrame Interface object that represents a frame, as determined by the dwEventType parameter. See the table in the Remarks.

nOffset

[in] An integer that specifies an offset, as determined by the dwEventType parameter. See the table in the Remarks section.

dwEventType

[in] A value of the CorDebugExceptionCallbackType Enumeration enumeration that specifies the type of this exception callback.

dwFlags

[in] A value of the CorDebugExceptionFlags Enumeration enumeration that specifies additional information about the exception

Remarks

The Exception callback is called at various points during the search phase of the exception-handling process. That is, it can be called more than once while unwinding an exception.

The exception being processed can be retrieved from the ICorDebugThread Interface object referenced by the pThread parameter.

The particular frame and offset are determined by the dwEventType parameter as follows:

Value of dwEventType Value of pFrame Value of nOffset

DEBUG_EXCEPTION_FIRST_CHANCE

The frame that threw the exception.

The instruction pointer in the frame.

DEBUG_EXCEPTION_USER_FIRST_CHANCE

The user-code frame closest to the point of the thrown exception.

The instruction pointer in the frame.

DEBUG_EXCEPTION_CATCH_HANDLER_FOUND

The frame containing the catch handler.

The IL offset of the beginning of the catch handler.

DEBUG_EXCEPTION_UNHANDLED

NULL

Undefined

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: CorDebug.idl

Library: CorGuids.lib

.NET Framework Version: 2.0

See Also

Reference

ICorDebugManagedCallback2 Interface
ICorDebugManagedCallback Interface