ICorDebugEval Interface

Provides methods to enable the debugger to execute code within the context of the code being debugged.

interface ICorDebugEval : IUnknown {
    HRESULT Abort ();
    HRESULT CallFunction (
        [in] ICorDebugFunction  *pFunction,
        [in] ULONG32            nArgs,
        [in, size_is(nArgs)] ICorDebugValue *ppArgs[]
    HRESULT CreateValue (
        [in] CorElementType     elementType,
        [in] ICorDebugClass     *pElementClass,
        [out] ICorDebugValue    **ppValue
    HRESULT GetResult (
        [out] ICorDebugValue    **ppResult
    HRESULT GetThread (
        [out] ICorDebugThread   **ppThread
    HRESULT IsActive (
        [out] BOOL              *pbActive
    HRESULT NewArray (
        [in] CorElementType     elementType,
        [in] ICorDebugClass     *pElementClass,
        [in] ULONG32            rank,
        [in, size_is(rank)] ULONG32 dims[],
            [in, size_is(rank)] ULONG32 lowBounds[]
    HRESULT NewObject (
        [in] ICorDebugFunction  *pConstructor,
        [in] ULONG32            nArgs,
        [in, size_is(nArgs)] ICorDebugValue *ppArgs[]
    HRESULT NewObjectNoConstructor (
        [in] ICorDebugClass     *pClass
    HRESULT NewString (
        [in] LPCWSTR            string

Method Description

ICorDebugEval::Abort Method

Aborts the computation this ICorDebugEval object is currently performing.

ICorDebugEval::CallFunction Method

Sets up a call to the specified function. (Obsolete in the .NET Framework version 2.0; use ICorDebugEval2::CallParameterizedFunction Method instead.)

ICorDebugEval::CreateValue Method

Gets an interface pointer to an ICorDebugValue Interface object of the specified type, with an initial value of zero or null. (Obsolete in the .NET Framework 2.0; use ICorDebugEval2::CreateValueForType Method instead.)

ICorDebugEval::GetResult Method

Gets an interface pointer to an ICorDebugValue that contains the results of the evaluation.

ICorDebugEval::GetThread Method

Gets an interface pointer to the ICorDebugThread Interface where this evaluation is executing or will execute.

ICorDebugEval::IsActive Method

Gets a value that indicates whether this ICorDebugEval object is currently executing.

ICorDebugEval::NewArray Method

Allocates a new array of the specified element type and dimensions. (Obsolete in the .NET Framework 2.0; use ICorDebugEval2::NewParameterizedArray Method instead.)

ICorDebugEval::NewObject Method

Allocates a new object instance and calls the specified constructor method. (Obsolete in the .NET Framework 2.0; use ICorDebugEval2::NewParameterizedObject Method instead.)

ICorDebugEval::NewObjectNoConstructor Method

Allocates a new object instance of the specified type, without attempting to call a constructor method. (Obsolete in the .NET Framework 2.0; use ICorDebugEval2::NewParameterizedObjectNoConstructor Method instead.)

ICorDebugEval::NewString Method

Allocates a new string object with the specified contents.

An ICorDebugEval object is created in the context of a specific thread that is used to perform the evaluations. All objects and types used in a given evaluation must reside within the same application domain. That application domain need not be the same as the current application domain of the thread. Evaluations can be nested.

The evaluation's operations do not complete until the debugger calls ICorDebugController::Continue Method, and then receives an ICorDebugManagedCallback::EvalComplete Method callback. If you need to use the evaluation functionality without allowing other threads to run, suspend the threads by using either ICorDebugController::SetAllThreadsDebugState Method or ICorDebugController::Stop Method before calling ICorDebugController::Continue Method.

Because user code is running when the evaluation is in progress, any debug events can occur, including class loads and breakpoints. The debugger will receive callbacks, as normal, for these events. The state of the evaluation will be seen as part of the inspection of the normal program state. The stack chain will be a CHAIN_FUNC_EVAL chain (see the CorDebugStepReason Enumeration enumeration and the ICorDebugChain::GetReason Method method). The full debugger API will continue to operate as normal.

If a deadlocked or infinite looping situation arises, the user code may never complete. In such a case, you must call ICorDebugEval::Abort Method before resuming the program.

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

Header: CorDebug.idl

Library: CorGuids.lib

.NET Framework Version: 2.0, 1.1, 1.0

Community Additions