The Pedigree Project
0.1
|
#include <StackFrameBase.h>
Public Member Functions | |
void | prettyPrint (HugeStaticString &buf) |
StackFrameBase (const ProcessorState &State, uintptr_t basePointer, LargeStaticString mangledSymbol) | |
virtual | ~StackFrameBase () |
Static Public Member Functions | |
static void | construct (ProcessorState &state, uintptr_t returnAddress, unsigned int nParams,...) |
Protected Attributes | |
symbol_t | m_Symbol |
const ProcessorState & | m_State |
uintptr_t | m_BasePointer |
Private Member Functions | |
virtual uintptr_t | getParameter (size_t n)=0 |
bool | isClassMember () |
void | format (uintptr_t n, const LargeStaticString &type, HugeStaticString &dest) |
Base class for all processor-specific StackFrame classes
Definition at line 32 of file StackFrameBase.h.
StackFrameBase::StackFrameBase | ( | const ProcessorState & | State, |
uintptr_t | basePointer, | ||
LargeStaticString | mangledSymbol | ||
) |
Creates a stack frame based on the given processor state and also the given symbol name (mangled).
Definition at line 24 of file StackFrameBase.cc.
References m_Symbol, and ~StackFrameBase().
|
virtualdefault |
The destructor does nothing
Referenced by StackFrameBase().
|
static |
Construct a stack frame, given a ProcessorState. The stack frame should be constructed to comply with the default ABI for the current architecture - that implies the stack may be changed, so the getStackPointer() member of ProcessorState must be valid.
[out] | state | The state to modify (construct a stack frame in). |
returnAddress | The return address of the stack frame. | |
nParams | The number of parameters to the stack frame. | |
... | The parameters, each sizeof(uintptr_t). |
|
private |
Formats a number, given the 'type' of that number.
Definition at line 62 of file StackFrameBase.cc.
Referenced by prettyPrint().
|
privatepure virtual |
Returns the n'th 32/64-bit parameter in the stack frame.
Implemented in ARMV7StackFrame, X86StackFrame, PPC32StackFrame, HostedStackFrame, X64StackFrame, ARM926EStackFrame, MIPS32StackFrame, and MIPS64StackFrame.
Referenced by prettyPrint().
|
private |
Returns whether the symbol is a class member function. This is calculated by a simple algorithm:
Definition at line 134 of file StackFrameBase.cc.
References m_Symbol.
Referenced by prettyPrint().
void StackFrameBase::prettyPrint | ( | HugeStaticString & | buf | ) |
Returns a pretty printed string containing the function name and each parameter with its value (hopefully).
Definition at line 35 of file StackFrameBase.cc.
References format(), getParameter(), isClassMember(), and m_Symbol.
|
protected |
The base pointer for this frame.
Definition at line 67 of file StackFrameBase.h.
Referenced by X86StackFrame::getParameter().
|
protected |
The processor state
Definition at line 65 of file StackFrameBase.h.
Referenced by X64StackFrame::getParameter(), and PPC32StackFrame::getParameter().
|
protected |
The symbol
Definition at line 63 of file StackFrameBase.h.
Referenced by isClassMember(), prettyPrint(), and StackFrameBase().