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::Backtrace ( )

Creates a new Backtrace object.

Definition at line 31 of file Backtrace.cc.

◆ ~Backtrace()

Backtrace::~Backtrace ( )

Definition at line 33 of file Backtrace.cc.

Member Function Documentation

◆ getBasePointer()

uintptr_t Backtrace::getBasePointer ( size_t  n)

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

Definition at line 163 of file Backtrace.cc.

References m_pBasePointers.

◆ getReturnAddress()

uintptr_t Backtrace::getReturnAddress ( size_t  n)

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

Definition at line 158 of file Backtrace.cc.

References m_pReturnAddresses.

◆ numStackFrames()

size_t Backtrace::numStackFrames ( )

Returns the number of stack frames retrieved.

Definition at line 154 of file Backtrace.cc.

References m_nStackFrames.

◆ performBacktrace()

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 35 of file Backtrace.cc.

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

Referenced by Backtracer::execute().

+ Here is the caller graph for this function:

◆ performBpBacktrace()

void Backtrace::performBpBacktrace ( uintptr_t  base,
uintptr_t  instruction 
)

Performs a "normal" backtrace, based on following a linked list of frame pointers.

Definition at line 82 of file Backtrace.cc.

References ProcessorBase::getBasePointer(), ProcessorBase::getInstructionPointer(), ProcessorBase::information(), m_nStackFrames, m_pBasePointers, m_pReturnAddresses, and m_pStates.

Referenced by SlamAllocator::allocate(), and performBacktrace().

+ Here is the caller graph for this function:

◆ performDwarfBacktrace()

void Backtrace::performDwarfBacktrace ( InterruptState &  state)
private

Performs a DWARF backtrace.

Definition at line 56 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:

◆ prettyPrint()

void Backtrace::prettyPrint ( HugeStaticString &  buf,
size_t  nFrames = 0,
size_t  nFromFrame = 0 
)

Definition at line 119 of file Backtrace.cc.

Friends And Related Symbol Documentation

◆ AllocationCommand

friend class AllocationCommand
friend

Definition at line 33 of file Backtrace.h.

◆ LocksCommand

friend class LocksCommand
friend

Definition at line 34 of file Backtrace.h.

◆ SlamAllocator

friend class SlamAllocator
friend

Definition at line 35 of file Backtrace.h.

Member Data Documentation

◆ m_nStackFrames

size_t Backtrace::m_nStackFrames
private

The number of stack frames retrieved by a performBacktrace call.

Definition at line 98 of file Backtrace.h.

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

◆ m_pBasePointers

uintptr_t Backtrace::m_pBasePointers[MAX_STACK_FRAMES]
private

The base pointers.

Definition at line 88 of file Backtrace.h.

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

◆ m_pReturnAddresses

uintptr_t Backtrace::m_pReturnAddresses[MAX_STACK_FRAMES]
private

The return addresses.

Definition at line 84 of file Backtrace.h.

Referenced by SlamAllocator::allocate(), getReturnAddress(), performBpBacktrace(), and performDwarfBacktrace().

◆ m_pStates

ProcessorState Backtrace::m_pStates[MAX_STACK_FRAMES]
private

Processor register states.

Definition at line 93 of file Backtrace.h.

Referenced by performBpBacktrace(), and performDwarfBacktrace().


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