pint_t
uint64_t getULEB128(pint_t &addr, pint_t end) {
int64_t getSLEB128(pint_t &addr, pint_t end) {
pint_t getEncodedP(pint_t &addr, pint_t end, uint8_t encoding,
pint_t startAddr = addr;
pint_t result;
addr = (addr + sizeof(pint_t) - 1) & sizeof(pint_t);
p += sizeof(pint_t);
addr = (pint_t)p;
addr = (pint_t)p;
addr = (pint_t)p;
addr = (pint_t)p;
addr = (pint_t)p;
addr = (pint_t)p;
addr = (pint_t)p;
bool findFDE(pint_t pc, pint_t &fdeStart, pint_t &data_base) {
pint_t base = n->hdr_base;
pint_t first = n->hdr_start;
for (pint_t len = n->hdr_entries; len > 1; ) {
pint_t next = first + (len / 2) * 8;
pint_t nextPC = base + (int32_t)get32(next);
bool addFDE(pint_t pcStart, pint_t pcEnd, pint_t fde) {
bool removeFDE(pint_t pcStart, pint_t pcEnd, pint_t fde) {
void removeDSO(pint_t ehFrameBase) {
pint_t hdr_base; // Pointer to FDE if hdr_start == 0
pint_t hdr_start;
pint_t hdr_entries;
pint_t first_pc;
pint_t last_pc;
pint_t data_base;
pint_t ehframe_base;
void addDSO(pint_t header, pint_t data_base) {
pint_t end = header + 4;
pint_t ehframe_base = getEncodedP(end, 0, get8(header + 1), NULL);
pint_t entries = getEncodedP(end, 0, get8(header + 2), NULL);
pint_t start = (end + 3) & ~pint_t(3);
pint_t tmp;
const LocalAddressSpace::pint_t *pc = (const LocalAddressSpace::pint_t *)pc_;
const LocalAddressSpace::pint_t *ptr = (const LocalAddressSpace::pint_t *)ptr_;
typedef void (*findPCRange_t)(LocalAddressSpace &, pint_t, pint_t &pcStart,
pint_t &pcEnd);
uint8_t get8(pint_t addr) {
uint16_t get16(pint_t addr) {
uint32_t get32(pint_t addr) {
uint64_t get64(pint_t addr) {
uintptr_t getP(pint_t addr) {
step_result DwarfInstructions<A, R>::stepWithDwarf(A &addressSpace, pint_t pc,
pint_t fdeStart,
pint_t cfa = getCFA(addressSpace, prolog, registers);
pint_t returnAddress = 0;
typename A::pint_t
DwarfInstructions<A, R>::evaluateExpression(pint_t expression, A &addressSpace,
pint_t initialStackValue) {
pint_t p = expression;
pint_t expressionEnd = expression + 20; // Rough estimate
pint_t stack[100];
pint_t *sp = stack;
pint_t value;
p += sizeof(pint_t);
typedef typename A::pint_t pint_t;
static step_result stepWithDwarf(A &, pint_t, pint_t, R &, unw_proc_info_t *);
static pint_t evaluateExpression(pint_t, A &, const R &, pint_t);
static pint_t
getSavedRegister(A &, const R &, pint_t,
static pint_t
computeRegisterLocation(A &, const R &, pint_t,
static pint_t getCFA(A &addressSpace,
typename A::pint_t DwarfInstructions<A, R>::getSavedRegister(
A &addressSpace, const R ®isters, pint_t cfa,
typename DwarfInstructions<A, R>::pint_t
A &addressSpace, const R ®isters, pint_t cfa,
static bool parseInstructions(A &, pint_t, pint_t, const CIE_Info &, pint_t,
void CFI_Parser<A, R>::findPCRange(A &addressSpace, pint_t fde, pint_t &pcStart,
pint_t &pcEnd) {
pint_t p = fde;
pint_t nextCFI = p + cfiLength;
pint_t cieStart = p - ciePointer;
bool CFI_Parser<A, R>::decodeFDE(A &addressSpace, pint_t fdeStart,
pint_t p = fdeStart;
pint_t nextCFI = p + cfiLength;
pint_t cieStart = p - ciePointer;
pint_t pcStart =
pint_t pcRange = addressSpace.getEncodedP(
pint_t endOfAug = p + augLen;
pint_t lsdaStart = p;
bool CFI_Parser<A, R>::parseCIE(A &addressSpace, pint_t cie,
pint_t p = cie;
pint_t cieContentEnd = p + cieLength;
pint_t strStart = p;
for (pint_t s = strStart; addressSpace.get8(s) != '\0'; ++s) {
pint_t upToPC, PrologInfo *results,
(pint_t)(-1), rememberStack, results, ctx))
typedef typename A::pint_t pint_t;
CFI_Parser<A, R>::parseInstructions(A &addressSpace, pint_t instructions,
pint_t instructionsEnd,
const CIE_Info &cieInfo, pint_t pcoffset,
pint_t p = instructions;
pint_t cieStart;
pint_t cieLength;
pint_t cieInstructions;
pint_t personality;
pint_t fdeStart;
pint_t fdeLength;
pint_t fdeInstructions;
pint_t pcStart;
pint_t pcEnd;
pint_t lsda;
static void findPCRange(A &, pint_t, pint_t &, pint_t &);
static bool decodeFDE(A &, pint_t, FDE_Info *, CIE_Info *,
pint_t, PrologInfo *, unw_proc_info_t *ctx);
static bool parseCIE(A &, pint_t, CIE_Info *);
pint_t fdeStart, data_base;
typedef typename A::pint_t pint_t;
bool getInfoFromDwarfSection(pint_t, pint_t, uint32_t, uint32_t);
pint_t pc = this->getIP();
MyCFIParser::pint_t pcStart, pcEnd;
MyCFIParser::pint_t pcStart, pcEnd;
sThisAddressSpace.removeDSO((LocalAddressSpace::pint_t)ehFrameStart);