Debugging Tools for Windows

GetStackTrace

The GetStackTrace method returns the frames at the top of the specified call stack.

HRESULT
  IDebugControl::GetStackTrace(
    IN ULONG64  FrameOffset,
    IN ULONG64  StackOffset,
    IN ULONG64  InstructionOffset,
    OUT PDEBUG_STACK_FRAME  Frames,
    IN ULONG  FramesSize,
    OUT OPTIONAL PULONG  FramesFilled
    );

Parameters

FrameOffset
Specifies the location of the stack frame at the top of the stack. If FrameOffset is set to zero, the current frame pointer is used instead.
StackOffset
Specifies the location of the current stack. If StackOffset is set to zero, the current stack pointer is used instead.
InstructionOffset
Specifies the location of the instruction of interest for the function that is represented by the stack frame at the top of the stack. If InstructionOffset is set to zero, the current instruction is used instead.
Frames
Receives the stack frames. The number of elements this array holds is FrameSize.
FrameSize
Specifies the number of items in the Frames array.
FramesFilled
Receives the number of frames that were placed in the array Frames. If FramesFilled is NULL, this information is not returned.

Return Value

S_OK
The method was successful.
E_FAIL
No stack frames were returned.

This method may also return other error values. See Return Values for more details.

Interface Version

GetStackTrace is available in all versions of IDebugControl.

Comments

The stack trace returned to Frames can be printed using OutputStackTrace.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

See Also

GetContextStackTrace, GetFrameOffset2, GetInstructionOffset2, GetStackOffset2, OutputStackTrace, k, kb, kd, kp, kP, kv (Display Stack Backtrace), StackTrace

Build machine: CAPEBUILD