Debugging Tools for Windows |
The GetContextStackTrace method returns the frames at the top of the call stack, starting with an arbitrary register context and returning the reconstructed register context for each stack frame.
HRESULT
IDebugControl4::GetContextStackTrace(
IN OPTIONAL PVOID StartContext,
IN ULONG StartContextSize,
OUT OPTIONAL PDEBUG_STACK_FRAME Frames,
IN ULONG FramesSize,
OUT OPTIONAL PVOID FrameContexts,
IN ULONG FrameContextsSize,
IN ULONG FrameContextsEntrySize,
OUT OPTIONAL PULONG FramesFilled
);
This method may also return error values. See Return Values for more details.
GetContextStackTrace is available in IDebugControl4 and later versions.
The stack trace returned to Frames and FrameContexts can be printed using OutputContextStackTrace.
It is common for stack unwinds to restore only a subset of the registers. For example, stack unwinds will not always restore the volatile register state because the volatile registers are scratch registers and code does not need to preserve them. Registers that are not restored on unwind are left as the last value restored, so care should be taken when using the register state that might not be restored by an unwind.
Headers: Defined in Dbgeng.h. Include Dbgeng.h. CONTEXT is defined in Ntddk.h.
GetStackTrace, k, kb, kd, kp, kP, kv (Display Stack Backtrace), OutputContextStackTrace,