ICorProfilerInfo4::GetCodeInfo3 Method

Gets the extents of native code associated with the JIT-recompiled version of the specified function.

Syntax

HRESULT GetCodeInfo3(  
    [in]  FunctionID functionID,  
    [in]  ReJITID reJitId,  
    [in]  ULONG32 cCodeInfos,  
    [out] ULONG32 *pcCodeInfos,  
    [out, size_is(cCodeInfos), length_is(*pcCodeInfos)]  
    COR_PRF_CODE_INFO codeInfos[]);  

Parameters

functionID
[in] The ID of the function with which the native code is associated.

reJitId
[in] The identity of the JIT-recompiled function.

cCodeInfos
[in] The size of the codeInfos array.

pcCodeInfos
[out] A pointer to the total number of COR_PRF_CODE_INFO structures available.

codeInfos
[out] A caller-provided buffer. After the method returns, it contains an array of COR_PRF_CODE_INFO structures, each of which describes a block of native code.

Remarks

The GetCodeInfo3 method is similar to GetCodeInfo2, except that it will get the JIT-recompiled ID of the function that contains the specified IP address.

Note

GetCodeInfo3 can trigger a garbage collection, whereas GetCodeInfo2 will not. For more information, see the CORPROF_E_UNSUPPORTED_CALL_SEQUENCE HRESULT.

The extents are sorted in order of increasing Common Intermediate Language (CIL) offset.

After GetCodeInfo3 returns, you must verify that the codeInfos buffer was large enough to contain all the COR_PRF_CODE_INFO structures. To do this, compare the value of cCodeInfos with the value of the cchName parameter. If cCodeInfos divided by the size of a COR_PRF_CODE_INFO structure is smaller than pcCodeInfos, allocate a larger codeInfos buffer, update cCodeInfos with the new, larger size, and call GetCodeInfo3 again.

Alternatively, you can first call GetCodeInfo3 with a zero-length codeInfos buffer to obtain the correct buffer size. You can then set the codeInfos buffer size to the value returned in pcCodeInfos, multiplied by the size of a COR_PRF_CODE_INFO structure, and call GetCodeInfo3 again.

Requirements

Platforms: See System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: Available since 4.5

See also