更新:2007 年 11 月
表示一个托管函数或方法。
interface ICorDebugFunction : IUnknown {
HRESULT CreateBreakpoint (
[out] ICorDebugFunctionBreakpoint **ppBreakpoint
);
HRESULT GetClass (
[out] ICorDebugClass **ppClass
);
HRESULT GetCurrentVersionNumber (
[out] ULONG32 *pnCurrentVersion
);
HRESULT GetILCode (
[out] ICorDebugCode **ppCode
);
HRESULT GetLocalVarSigToken (
[out] mdSignature *pmdSig
);
HRESULT GetModule (
[out] ICorDebugModule **ppModule
);
HRESULT GetNativeCode (
[out] ICorDebugCode **ppCode
);
HRESULT GetToken (
[out] mdMethodDef *pMethodDef
);
};
方法
方法 |
说明 |
---|---|
在此函数开始时创建断点。 |
|
获取一个 ICorDebugClass 对象,该对象表示此函数所属的类。 |
|
获取对此函数进行的最后一次编辑的版本号。 |
|
获取此函数的 Microsoft 中间语言 (MSIL) 代码。 |
|
获取一个元数据标记,它指向由此 ICorDebugFunction 实例表示的函数的局部变量签名。 |
|
获取在其中定义此函数的模块。 |
|
获取此函数的本机代码。 |
|
获取此函数的元数据标记。 |
备注
ICorDebugFunction 接口不表示带有泛型类型参数的函数。例如,ICorDebugFunction 实例将表示 Func<T> 而非 Func<string>。调用 ICorDebugILFrame2::EnumerateTypeParameters 可获取泛型类型参数。
一个方法的元数据标记 mdMethodDef 与方法的 ICorDebugFunction 对象之间的关系取决于是否允许对该函数应用“编辑并继续”:
如果不允许对该函数应用“编辑并继续”,则 ICorDebugFunction 对象和 mdMethodDef 标记之间存在一对一的关系。即,该函数具有一个 ICorDebugFunction 对象和一个 mdMethodDef 标记。
如果允许对该函数应用“编辑并继续”,则 ICorDebugFunction 对象和 mdMethodDef 标记之间存在多对一的关系。即,该函数可能具有 ICorDebugFunction 的多个实例(一个函数版本具有一个实例),但只有一个 mdMethodDef 标记。
要求
**平台:**请参见 .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