获取 ICorDebugStackWalk 对象中的当前帧。
Syntax
HRESULT GetFrame([out] ICorDebugFrame ** pFrame);
参数
pFrame
[in]指向所创建帧对象的地址的指针,该对象表示堆栈中的当前帧。
返回值
此方法返回以下特定的 HRESULT 以及指示方法失败的 HRESULT 错误。
| HRESULT | Description |
|---|---|
| S_OK | 运行时已成功返回当前帧。 |
| E_FAIL | 未返回当前帧。 |
| S_FALSE | 当前帧是本机堆栈帧。 |
| E_INVALIDARG |
pFrame 为 null。 |
| CORDBG_E_PAST_END_OF_STACK | 帧指针已位于堆栈的末尾;因此,无法访问其他帧。 |
例外
注解
ICorDebugStackWalk 仅返回实际堆栈帧。 使用 ICorDebugThread3::GetActiveInternalFrames 方法返回内部帧。 (内部帧是运行时推送到堆栈中的数据结构来存储临时数据。
要求
平台: 请参阅 .NET 支持的作系统。
页眉: CorDebug.idl、CorDebug.h
图书馆: CorGuids.lib
.NET 版本: 自 .NET Framework 4.0 起可用