The Pedigree Project  0.1
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Backtrace Class Reference
+ Collaboration diagram for Backtrace:

Public Member Functions

 Backtrace ()
 
void performBacktrace (InterruptState &state)
 
size_t numStackFrames ()
 
uintptr_t getReturnAddress (size_t n)
 
uintptr_t getBasePointer (size_t n)
 
void prettyPrint (HugeStaticString &buf, size_t nFrames=0, size_t nFromFrame=0)
 
void performBpBacktrace (uintptr_t base, uintptr_t instruction)
 

Private Member Functions

void performDwarfBacktrace (InterruptState &state)
 

Private Attributes

uintptr_t m_pReturnAddresses [MAX_STACK_FRAMES]
 
uintptr_t m_pBasePointers [MAX_STACK_FRAMES]
 
ProcessorState m_pStates [MAX_STACK_FRAMES]
 
size_t m_nStackFrames
 

Friends

class AllocationCommand
 
class LocksCommand
 
class SlamAllocator
 

Detailed Description

Definition at line 32 of file Backtrace.h.

Constructor & Destructor Documentation

Backtrace::Backtrace ( )

Creates a new Backtrace object.

Definition at line 31 of file Backtrace.cc.

Member Function Documentation

uintptr_t Backtrace::getBasePointer ( size_t  n)

Returns the base pointer of the n'th stack frame.

Definition at line 242 of file Backtrace.cc.

References m_pBasePointers.

uintptr_t Backtrace::getReturnAddress ( size_t  n)

Returns the return address of the n'th stack frame.

Definition at line 236 of file Backtrace.cc.

References m_pReturnAddresses.

Referenced by LocksCommand::setFatal().

+ Here is the caller graph for this function:

size_t Backtrace::numStackFrames ( )

Returns the number of stack frames retrieved.

Definition at line 231 of file Backtrace.cc.

References m_nStackFrames.

Referenced by LocksCommand::setFatal().

+ Here is the caller graph for this function:

void Backtrace::performBacktrace ( InterruptState &  state)

Performs a backtrace from the given base pointer address, or if none was specified, the current EBP location.

Definition at line 39 of file Backtrace.cc.

References KernelElf::instance(), performBpBacktrace(), and performDwarfBacktrace().

Referenced by Backtracer::execute().

+ Here is the caller graph for this function:

void Backtrace::performBpBacktrace ( uintptr_t  base,
uintptr_t  instruction 
)
void Backtrace::performDwarfBacktrace ( InterruptState &  state)
private

Performs a DWARF backtrace.

Definition at line 65 of file Backtrace.cc.

References KernelElf::instance(), m_nStackFrames, m_pBasePointers, m_pReturnAddresses, m_pStates, and DwarfUnwinder::unwind().

Referenced by performBacktrace().

+ Here is the caller graph for this function:

Member Data Documentation

size_t Backtrace::m_nStackFrames
private

The number of stack frames retrieved by a performBacktrace call.

Definition at line 102 of file Backtrace.h.

Referenced by numStackFrames(), performBpBacktrace(), and performDwarfBacktrace().

uintptr_t Backtrace::m_pBasePointers[MAX_STACK_FRAMES]
private

The base pointers.

Definition at line 92 of file Backtrace.h.

Referenced by getBasePointer(), performBpBacktrace(), and performDwarfBacktrace().

uintptr_t Backtrace::m_pReturnAddresses[MAX_STACK_FRAMES]
private
ProcessorState Backtrace::m_pStates[MAX_STACK_FRAMES]
private

Processor register states.

Definition at line 97 of file Backtrace.h.

Referenced by performBpBacktrace(), and performDwarfBacktrace().


The documentation for this class was generated from the following files: