IDiaStackFrame

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Exposes the properties of a stack frame.

Syntax

IDiaStackFrame : IUnknown  

Methods in Vtable Order

The following are methods supported by this interface:

Method Description
IDiaStackFrame::get_allocatesBasePointer Retrieves a flag indicating that the base pointer is allocated for code in this address range. This method is deprecated.
IDiaStackFrame::get_base Retrieves the address base of the frame.
IDiaStackFrame::get_cplusplusExceptionHandling Retrieves a flag indicating that C++ exception handling is in effect.
IDiaStackFrame::get_functionStart Retrieves a flag indicating that the block contains the entry point of a function.
IDiaStackFrame::get_lengthLocals Retrieves the number of bytes of local variables pushed on the stack.
IDiaStackFrame::get_lengthParams Retrieves the number of bytes of parameters pushed on the stack.
IDiaStackFrame::get_lengthProlog Retrieves the number of bytes of prologue code in the block
IDiaStackFrame::get_lengthSavedRegisters Retrieves the number of bytes of saved registers pushed on the stack.
IDiaStackFrame::get_localsBase Retrieves the address base of the locals.
IDiaStackFrame::get_maxStack Retrieves the maximum number of bytes pushed on the stack in the frame.
IDiaStackFrame::get_rawLVarInstanceValue Retrieves the value of the specified local variable as raw bytes.
IDiaStackFrame::get_registerValue Retrieves the value of a specified register.
IDiaStackFrame::get_returnAddress Retrieves the return address of the frame.
IDiaStackFrame::get_size Retrieves the size of the frame in bytes.
IDiaStackFrame::get_systemExceptionHandling Retrieves a flag indicating that system exception handling is in effect.
IDiaStackFrame::get_type Retrieves the frame type.

Remarks

A stack frame is an abstraction of a function call during its execution.

Notes for Callers

Obtain this interface by calling the IDiaEnumStackFrames::Next method. See the IDiaEnumStackFrames interface for an example on obtaining the IDiaStackFrame interface.

Example

This example displays various attributes of a stack frame.

void PrintStackFrame(IDiaStackFrame* pFrame)  
{  
    if (pFrame != NULL)  
    {  
        ULONGLONG bottom = 0;  
        ULONGLONG top    = 0;  
  
        if (pFrame->get_base(&bottom) == S_OK &&  
            pFrame->get_registerValue( CV_REG_ESP, &top ) == S_OK )  
        {  
             printf("range = 0x%08I64x - 0x%08I64x\n", bottom, top);  
        }  
  
        ULONGLONG returnAddress = 0;  
        if (pFrame->get_returnAddress(&returnAddress) == S_OK)  
        {  
             printf("return address = 0x%08I64x\n", returnAddress);  
        }  
  
        DWORD lengthFrame     = 0;  
        DWORD lengthLocals    = 0;  
        DWORD lengthParams    = 0;  
        DWORD lengthProlog    = 0;  
        DWORD lengthSavedRegs = 0;  
        if (pFrame->get_size(&lengthFrame) == S_OK &&  
            pFrame->get_lengthLocals(&lengthLocals) == S_OK &&  
            pFrame->get_lengthParams(&lengthParams) == S_OK &&  
            pFrame->get_lengthProlog(&lengthProlog) == S_OK &&  
            pFrame->get_lengthSavedRegisters(&lengthSavedRegs) == S_OK)  
        {  
            printf("stack frame size          = 0x%08lx bytes\n", lengthFrame);  
            printf("length of locals          = 0x%08lx bytes\n", lengthLocals);  
            printf("length of parameters      = 0x%08lx bytes\n", lengthParams);  
            printf("length of prolog          = 0x%08lx bytes\n", lengthProlog);  
            printf("length of saved registers = 0x%08lx bytes\n", lengthSavedRegs);  
        }  
    }  
}  

Requirements

Header: Dia2.h

Library: diaguids.lib

DLL: msdia80.dll

See Also

Interfaces (Debug Interface Access SDK)
IDiaEnumStackFrames
IDiaEnumStackFrames::Next
IDiaStackWalkFrame