ICorDebugManagedCallback

更新:2007 年 11 月

提供用于处理调试器回调的方法。

interface ICorDebugManagedCallback : IUnknown {
    HRESULT _stdcall Break(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugThread* thread);
    HRESULT _stdcall Breakpoint(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugThread* pThread, 
                    [in] ICorDebugBreakpoint* pBreakpoint);
    HRESULT _stdcall BreakpointSetError(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugThread* pThread, 
                    [in] ICorDebugBreakpoint* pBreakpoint, 
                    [in] unsigned long dwError);
    HRESULT _stdcall ControlCTrap([in] ICorDebugProcess* pProcess);
    HRESULT _stdcall CreateAppDomain(
                    [in] ICorDebugProcess* pProcess, 
                    [in] ICorDebugAppDomain* pAppDomain);
    HRESULT _stdcall CreateProcess([in] ICorDebugProcess* pProcess);
    HRESULT _stdcall CreateThread(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugThread* thread);
    HRESULT _stdcall DebuggerError(
                    [in] ICorDebugProcess* pProcess, 
                    [in] HRESULT errorHR, 
                    [in] unsigned long errorCode);
    HRESULT _stdcall EditAndContinueRemap(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugThread* pThread, 
                    [in] ICorDebugFunction* pFunction, 
                    [in] long fAccurate);
    HRESULT _stdcall EvalComplete(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugThread* pThread, 
                    [in] ICorDebugEval* pEval);
    HRESULT _stdcall EvalException(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugThread* pThread, 
                    [in] ICorDebugEval* pEval);
    HRESULT _stdcall Exception(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugThread* pThread, 
                    [in] long unhandled);
    HRESULT _stdcall ExitAppDomain(
                    [in] ICorDebugProcess* pProcess, 
                    [in] ICorDebugAppDomain* pAppDomain);
    HRESULT _stdcall ExitProcess([in] ICorDebugProcess* pProcess);
    HRESULT _stdcall ExitThread(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugThread* thread);
    HRESULT _stdcall LoadAssembly(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugAssembly* pAssembly);
    HRESULT _stdcall LoadClass(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugClass* c);
    HRESULT _stdcall LoadModule(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugModule* pModule);
    HRESULT _stdcall LogMessage(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugThread* pThread, 
                    [in] long lLevel, 
                    [in] unsigned short* pLogSwitchName, 
                    [in] unsigned short* pMessage);
    HRESULT _stdcall LogSwitch(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugThread* pThread, 
                    [in] long lLevel, 
                    [in] unsigned long ulReason, 
                    [in] unsigned short* pLogSwitchName, 
                    [in] unsigned short* pParentName);
    HRESULT _stdcall NameChange(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugThread* pThread);
    HRESULT _stdcall StepComplete(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugThread* pThread, 
                    [in] ICorDebugStepper* pStepper, 
                    [in] CorDebugStepReason reason);
    HRESULT _stdcall UnloadAssembly(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugAssembly* pAssembly);
    HRESULT _stdcall UnloadClass(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugClass* c);
    HRESULT _stdcall UnloadModule(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugModule* pModule);
    HRESULT _stdcall UpdateModuleSymbols(
                    [in] ICorDebugAppDomain* pAppDomain, 
                    [in] ICorDebugModule* pModule, 
                    [in] IStream* pSymbolStream);
};

方法

方法

说明

ICorDebugManagedCallback::Break 方法

执行代码流中的 Break 指令时通知调试器。

ICorDebugManagedCallback::Breakpoint 方法

当遇到断点时通知调试器。

ICorDebugManagedCallback::BreakpointSetError 方法

通知调试器公共语言运行库 (CLR) 无法精确绑定在实时 (JIT) 编译函数之前设置的断点。

ICorDebugManagedCallback::ControlCTrap 方法

通知调试器在正在调试的进程中捕获了 Ctrl+C。

ICorDebugManagedCallback::CreateAppDomain 方法

通知调试器已创建了一个应用程序域。

ICorDebugManagedCallback::CreateProcess 方法

在第一次附加到进程或启动了进程时通知调试器。

ICorDebugManagedCallback::CreateThread 方法

通知调试器线程已经开始执行托管代码。

ICorDebugManagedCallback::DebuggerError 方法

通知调试器在尝试处理 CLR 中的事件时发生了错误。

ICorDebugManagedCallback::EditAndContinueRemap 方法

已否决。通知调试器重新映射事件已发送到 IDE。

ICorDebugManagedCallback::EvalComplete 方法

通知调试器已完成计算。

ICorDebugManagedCallback::EvalException 方法

通知调试器因出现未处理的异常而终止了计算。

ICorDebugManagedCallback::Exception 方法

通知调试器已从托管代码中引发了异常。

ICorDebugManagedCallback::ExitAppDomain 方法

通知调试器已退出了一个应用程序域。

ICorDebugManagedCallback::ExitProcess 方法

通知调试器已退出进程。

ICorDebugManagedCallback::ExitThread 方法

通知调试器已经退出了执行托管代码的线程。

ICorDebugManagedCallback::LoadAssembly 方法

通知调试器已经成功地加载了 CLR 程序集。

ICorDebugManagedCallback::LoadClass 方法

通知调试器已经加载了某个类。

ICorDebugManagedCallback::LoadModule 方法

通知调试器已经成功地加载了 CLR 模块。

ICorDebugManagedCallback::LogMessage 方法

通知调试器 CLR 托管线程调用了 EventLog 类中的方法来记录事件。

ICorDebugManagedCallback::LogSwitch 方法

通知调试器 CLR 托管线程调用了 Switch 类中的方法来创建、修改或删除调试/跟踪开关。

ICorDebugManagedCallback::NameChange 方法

通知调试器应用程序域或线程的名称发生了更改。

ICorDebugManagedCallback::StepComplete 方法

通知调试器步骤已完成。

ICorDebugManagedCallback::UnloadAssembly 方法

通知调试器已经卸载了 CLR 程序集。

ICorDebugManagedCallback::UnloadClass 方法

通知调试器正在卸载某个类。

ICorDebugManagedCallback::UnloadModule 方法

通知调试器已经卸载了 CLR 模块 (DLL)。

ICorDebugManagedCallback::UpdateModuleSymbols 方法

通知调试器 CLR 模块的符号已发生更改。

备注

所有回调都已序列化,都在同一线程中调用,并在进程处于同步状态时调用。

每个回调实现都必须调用 ICorDebugController::Continue 才能继续执行。如果在回调返回前未调用 ICorDebugController::Continue,该进程将保持停止状态,不会再发生事件回调,直至调用 ICorDebugController::Continue 为止。

如果调试器正在调试 .NET Framework 2.0 版的应用程序,它必须实现 ICorDebugManagedCallback2ICorDebugManagedCallbackICorDebugManagedCallback2 的实例作为回调对象传递给 ICorDebug::SetManagedHandler

要求

**平台:**请参见 .NET Framework 系统要求

**头文件:**CorDebug.idl

**库:**CorGuids.lib

**.NET Framework 版本:**3.5 SP1、3.5、3.0 SP1、3.0、2.0 SP1、2.0、1.1、1.0

请参见

参考

ICorDebug

ICorDebugManagedCallback2

其他资源

调试接口