ICorDebugFunction 介面ICorDebugFunction Interface

表示 Managed 函式或方法。Represents a managed function or method.


方法Method 描述Description
CreateBreakpoint 方法CreateBreakpoint Method 在此函數的開頭建立中斷點。Creates a breakpoint at the beginning of this function.
GetClass 方法GetClass Method 取得 ICorDebugClass 物件,這個物件表示此函式所屬的類別。Gets an ICorDebugClass object that represents the class this function is a member of.
GetCurrentVersionNumber 方法GetCurrentVersionNumber Method 取得對此函數所做之最新編輯的版本號碼。Gets the version number of the latest edit made to this function.
GetILCode 方法GetILCode Method 取得此函式的 Microsoft 中繼語言 (MSIL) 程式碼。Gets the Microsoft intermediate language (MSIL) code for this function.
GetLocalVarSigToken 方法GetLocalVarSigToken Method 取得這個實例所表示之函式的區域變數簽章的元資料標記 ICorDebugFunctionGets the metadata token for the local variable signature of the function that is represented by this ICorDebugFunction instance.
GetModule 方法GetModule Method 取得定義此函數的模組。Gets the module in which this function is defined.
GetNativeCode 方法GetNativeCode Method 取得此函式的原生程式碼。Gets the native code for this function.
GetToken 方法GetToken Method 取得此函式的元資料標記。Gets the metadata token for this function.


ICorDebugFunction介面不代表具有泛型型別參數的函數。The ICorDebugFunction interface does not represent a function with generic type parameters. 例如, ICorDebugFunction 實例會代表 Func<T> 但不是 Func<string>For example, an ICorDebugFunction instance would represent Func<T> but not Func<string>. 呼叫 ICorDebugILFrame2:: EnumerateTypeParameters 以取得泛型型別參數。Call ICorDebugILFrame2::EnumerateTypeParameters to get the generic type parameters.

方法的元資料標記、和方法的物件之間的關聯性, mdMethodDef ICorDebugFunction 取決於函數是否允許編輯後繼續:The relationship between a method's metadata token, mdMethodDef, and a method's ICorDebugFunction object is dependent upon whether Edit and Continue is allowed on the function:

  • 如果函式不允許 [編輯後繼續],則物件與權杖之間會有一對一的關聯性 ICorDebugFunction mdMethodDefIf Edit and Continue is not allowed on the function, a one-to-one relationship exists between the ICorDebugFunction object and the mdMethodDef token. 也就是說,函式有一個 ICorDebugFunction 物件和一個 mdMethodDef token。That is, the function has one ICorDebugFunction object and one mdMethodDef token.

  • 如果函式允許 [編輯後繼續],則物件與權杖之間存在多對一關聯性 ICorDebugFunction mdMethodDefIf Edit and Continue is allowed on the function, a many-to-one relationship exists between the ICorDebugFunction object and the mdMethodDef token. 也就是說,函式可能有許多實例 ICorDebugFunction ,每個版本的函式都有一個,但只有一個 mdMethodDef 標記。That is, the function may have many instances of ICorDebugFunction, one for each version of the function, but only one mdMethodDef token.


這個介面不支援跨電腦或跨處理序的遠端呼叫。This interface does not support being called remotely, either cross-machine or cross-process.


平台: 請參閱 系統需求Platforms: See System Requirements.

標頭: CorDebug.idl、CorDebug.hHeader: CorDebug.idl, CorDebug.h

連結 庫: Corguids.lib .libLibrary: CorGuids.lib

.NET Framework 版本:自 1.0 起可用Available since 1.0.NET Framework Versions: 自 1.0 起可用Available since 1.0

另請參閱See also