ICorDebugCode

更新:2007 年 11 月

表示 Microsoft 中间语言 (MSIL) 代码段或本机代码段。

interface ICorDebugCode : IUnknown {
    HRESULT CreateBreakpoint (
        [in] ULONG32     offset,
        [out] ICorDebugFunctionBreakpoint **ppBreakpoint
    );
        
    HRESULT GetAddress (
        [out] CORDB_ADDRESS *pStart
    );
        
    HRESULT GetCode (
        [in] ULONG32     startOffset, 
        [in] ULONG32     endOffset,
        [in] ULONG32     cBufferAlloc,
        [out, size_is(cBufferAlloc),
            length_is(*pcBufferSize)] BYTE buffer[],
        [out] ULONG32    *pcBufferSize
    );
        
    //
      // GetEnCRemapSequencePoints is not implemented.
    //
    HRESULT GetEnCRemapSequencePoints (
        [in] ULONG32     cMap,
        [out] ULONG32    *pcMap,
        [out, size_is(cMap), length_is(*pcMap)]
            ULONG32      offsets[]
    );
        
    HRESULT GetFunction (
        [out] ICorDebugFunction **ppFunction
    );
        
    HRESULT GetILToNativeMapping (
        [in] ULONG32     cMap,
        [out] ULONG32    *pcMap,
        [out, size_is(cMap), length_is(*pcMap)]
            COR_DEBUG_IL_TO_NATIVE_MAP map[]
    );
        
    HRESULT GetSize (
        [out] ULONG32    *pcBytes
    );
        
    HRESULT GetVersionNumber (
        [out] ULONG32    *nVersion
    );
        
    HRESULT IsIL (
        [out] BOOL       *pbIL
    );
};

方法

方法

说明

ICorDebugCode::CreateBreakpoint 方法

在指定的偏移量处创建断点。

ICorDebugCode::GetAddress 方法

获取此 ICorDebugCode 表示的代码段的相对虚拟地址 (RVA)。

ICorDebugCode::GetCode 方法

获取指定函数中为反汇编而格式化的所有代码。此方法在 .NET Framework 2.0 版中已被否决。改用 ICorDebugCode2::GetCodeChunks

ICorDebugCode::GetEnCRemapSequencePoints 方法

未实现。

ICorDebugCode::GetFunction 方法

获取与此 ICorDebugCode 关联的 ICorDebugFunction

ICorDebugCode::GetILToNativeMapping 方法

获取一个由 COR_DEBUG_IL_TO_NATIVE_MAP 实例构成的数组,这些实例表示从 MSIL 偏移量到本机偏移量的映射。

ICorDebugCode::GetSize 方法

获取此 ICorDebugCode 表示的二进制代码的大小(以字节为单位)。

ICorDebugCode::GetVersionNumber 方法

获取从 1 开始的编号,该编号标识此 ICorDebugCode 表示的代码的版本。

ICorDebugCode::IsIL 方法

获取一个值,该值指示此 ICorDebugCode 是否是用 MSIL 编译的。

备注

ICorDebugCode 对象和 ICorDebugFunction 对象之间存在一对一的关系。即,每个 ICorDebugFunction 实例都有一个 ICorDebugCode 实例。

要求

**平台:**请参见 .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

请参见

参考

ICorDebugCode2

其他资源

调试接口