IDebugControl5::GetStackTraceEx method (dbgeng.h)

The GetStackTraceEx method returns the frames at the top of the specified call stack. The GetStackTraceEx method provides inline frame support. For more information about working with inline functions, see Debugging Optimized Code and Inline Functions.

Syntax

HRESULT GetStackTraceEx(
  [in]            ULONG64               FrameOffset,
  [in]            ULONG64               StackOffset,
  [in]            ULONG64               InstructionOffset,
  [out, writes]   PDEBUG_STACK_FRAME_EX Frames,
  [in]            ULONG                 FramesSize,
  [out, optional] PULONG                FramesFilled
);

Parameters

[in] 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.

[in] StackOffset

Specifies the location of the current stack. If StackOffset is set to zero, the current stack pointer is used instead.

[in] 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.

[out, writes] Frames

Receives the stack frames. The number of elements this array holds is FrameSize.

[in] FramesSize

Specifies the number of items in the Frames array.

[out, optional] FramesFilled

Receives the number of frames that were placed in the array Frames. If FramesFilled is NULL, this information is not returned.

Return value

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

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

Remarks

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

Requirements

Requirement Value
Target Platform Desktop
Header dbgeng.h (include Dbgeng.h)

See also

GetContextStackTraceEx

GetFrameOffset2

GetInstructionOffset2

GetStackOffset2

IDebugControl5

OutputStackTraceEx

StackTrace

k, kb, kc, kd, kp, kP, kv (Display Stack Backtrace)