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

Public Member Functions

 DwarfUnwinder (uintptr_t nData, size_t nLength)
 
bool unwind (const ProcessorState &inState, ProcessorState &outState, uintptr_t &frameBase)
 

Static Public Member Functions

static uint32_t decodeUleb128 (uint8_t *pBase, uint32_t &nOffset)
 
static int32_t decodeSleb128 (uint8_t *pBase, uint32_t &nOffset)
 

Private Attributes

uintptr_t m_nData
 
size_t m_nLength
 

Detailed Description

Definition at line 29 of file DwarfUnwinder.h.

Constructor & Destructor Documentation

DwarfUnwinder::DwarfUnwinder ( uintptr_t  nData,
size_t  nLength 
)

Creates a DwarfUnwinder object defined by frame definitions at nData, which has a maximum size of nLength.

Definition at line 26 of file DwarfUnwinder.cc.

Member Function Documentation

int32_t DwarfUnwinder::decodeSleb128 ( uint8_t *  pBase,
uint32_t &  nOffset 
)
static

Decodes a SLEB128 encoded number.

Parameters
[in]pBaseA pointer, to which nOffset is added to find the SLEB string.
[in,out]nOffsetAn offset to add to pBase to find the SLEB string. This is incremented by the function, and the function ends with it pointing to the byte after the SLEB number.
Returns
An integer representation of the SLEB128 number.
See also
DWARF specification v3.0, Appendix C.

Definition at line 363 of file DwarfUnwinder.cc.

Referenced by DwarfCfiAutomaton::executeInstruction(), and unwind().

+ Here is the caller graph for this function:

uint32_t DwarfUnwinder::decodeUleb128 ( uint8_t *  pBase,
uint32_t &  nOffset 
)
static

Decodes a ULEB128 encoded number.

Parameters
[in]pBaseA pointer, to which nOffset is added to find the ULEB string.
[in,out]nOffsetAn offset to add to pBase to find the ULEB string. This is incremented by the function, and the function ends with it pointing to the byte after the ULEB number.
Returns
An integer representation of the ULEB128 number.
See also
DWARF specification v3.0, Appendix C.

Definition at line 348 of file DwarfUnwinder.cc.

Referenced by DwarfCfiAutomaton::executeInstruction(), and unwind().

+ Here is the caller graph for this function:

bool DwarfUnwinder::unwind ( const ProcessorState &  inState,
ProcessorState &  outState,
uintptr_t &  frameBase 
)

Populates outState with the result of unwinding one stack frame from inState.

Parameters
[in]inStateThe starting state.
[out]outStateThe state after one stack frame has been unwound.
Returns
False if the frame could not be unwound, true otherwise.

Definition at line 35 of file DwarfUnwinder.cc.

References decodeSleb128(), decodeUleb128(), DwarfCfiAutomaton::execute(), DwarfState::getRegister(), DwarfCfiAutomaton::initialise(), m_nData, m_nLength, and DwarfState::m_R.

Referenced by Backtrace::performDwarfBacktrace().

+ Here is the caller graph for this function:

Member Data Documentation

uintptr_t DwarfUnwinder::m_nData
private

Address of our frame data.

Definition at line 75 of file DwarfUnwinder.h.

Referenced by unwind().

size_t DwarfUnwinder::m_nLength
private

Length of our frame data..

Definition at line 80 of file DwarfUnwinder.h.

Referenced by unwind().


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