IDiaStackFrame
Exposes the properties of a stack frame.
IDiaStackFrame : IUnknown
Methods in Vtable Order
The following are methods supported by this interface:
Method |
Description |
---|---|
Retrieves a flag indicating that the base pointer is allocated for code in this address range. This method is deprecated. |
|
Retrieves the address base of the frame. |
|
Retrieves a flag indicating that C++ exception handling is in effect. |
|
Retrieves a flag indicating that the block contains the entry point of a function. |
|
Retrieves the number of bytes of local variables pushed on the stack. |
|
Retrieves the number of bytes of parameters pushed on the stack. |
|
Retrieves the number of bytes of prologue code in the block |
|
Retrieves the number of bytes of saved registers pushed on the stack. |
|
Retrieves the address base of the locals. |
|
Retrieves the location of the specified local variable. |
|
Retrieves the maximum number of bytes pushed on the stack in the frame. |
|
Retrieves the value of the specified local variable as raw bytes. |
|
Retrieves the value of a specified register. |
|
Retrieves the return address of the frame. |
|
Retrieves the size of the frame in bytes. |
|
Retrieves a flag indicating that system exception handling is in effect. |
|
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