ICorDebugILCode2::GetInstrumentedILMap 方法ICorDebugILCode2::GetInstrumentedILMap Method

[.NET Framework 4.5.2 與更新版本提供支援][Supported in the .NET Framework 4.5.2 and later versions]

將對應從分析工具檢測中繼語言 (IL) 位移傳回至此執行個體的原始方法 IL 位移。Returns a map from profiler-instrumented intermediate language (IL) offsets to original method IL offsets for this instance.


HRESULT GetInstrumentedILMap(  
   [in] ULONG32 cMap,  
   [out] ULONG32 *pcMap,  
   [out, size_is(cMap), length_is(*pcMap)] COR_IL_MAP map[]  


[in] map 陣列的儲存體容量。[in] The storage capacity of the map array. 如需詳細資訊,請參閱<備註>一節。See the Remarks section for more information.

[out] 寫入至對應陣列的 COR_IL_MAP 值數目。[out] The number of COR_IL_MAP values written to the map array.

[out] COR_IL_MAP 值陣列,這些值提供從分析工具檢測 IL 對應至原始方法 IL 的相關資訊。[out] An array of COR_IL_MAP values that provide information on mappings from profiler-instrumented IL to the IL of the original method.


如果分析工具藉由呼叫 ICorProfilerInfo:: SetILInstrumentedCodeMap 方法來設定對應,偵錯工具就可以在計算堆疊追蹤和變數存留期的 IL 位移時,呼叫這個方法來取出對應,並在內部使用對應。If the profiler sets the mapping by calling the ICorProfilerInfo::SetILInstrumentedCodeMap method, the debugger can call this method to retrieve the mapping and to use the mapping internally when calculating IL offsets for stack traces and variable lifetimes.

如果 cMap 為0且 pcMap 為非 nullpcMap 則會設定為可用 COR_IL_MAP 值的數目。If cMap is 0 and pcMap is non-null, pcMap is set to the number of available COR_IL_MAP values. 如果 cMap 不是零,則代表 map 陣列的儲存體容量。If cMap is non-zero, it represents the storage capacity of the map array. 當方法傳回時, map 會包含專案的最大值 cMap ,並 pcMap 設定為實際寫入陣列 COR_IL_MAP 值的數目 mapWhen the method returns, map contains a maximum of cMap items, and pcMap is set to the number of COR_IL_MAP values actually written to the map array.

如果 IL 未經檢測,或是分析工具未提供對應,此方法會傳回 S_OK,並將 pcMap 設為 0。If the IL hasn't been instrumented or the mapping wasn't provided by a profiler, this method returns S_OK and sets pcMap to 0.


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

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

程式庫: CorGuids.libLibrary: CorGuids.lib

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

另請參閱See also