Changeset View
Changeset View
Standalone View
Standalone View
src/UnwindCursor.hpp
Show First 20 Lines • Show All 975 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
#if defined(_LIBUNWIND_TARGET_MIPS_NEWABI) | #if defined(_LIBUNWIND_TARGET_MIPS_NEWABI) | ||||
int stepWithCompactEncoding(Registers_mips_newabi &) { | int stepWithCompactEncoding(Registers_mips_newabi &) { | ||||
return UNW_EINVAL; | return UNW_EINVAL; | ||||
} | } | ||||
#endif | #endif | ||||
#if defined(_LIBUNWIND_TARGET_SPARC) | |||||
int stepWithCompactEncoding(Registers_sparc &) { return UNW_EINVAL; } | |||||
#endif | |||||
bool compactSaysUseDwarf(uint32_t *offset=NULL) const { | bool compactSaysUseDwarf(uint32_t *offset=NULL) const { | ||||
R dummy; | R dummy; | ||||
return compactSaysUseDwarf(dummy, offset); | return compactSaysUseDwarf(dummy, offset); | ||||
} | } | ||||
#if defined(_LIBUNWIND_TARGET_X86_64) | #if defined(_LIBUNWIND_TARGET_X86_64) | ||||
bool compactSaysUseDwarf(Registers_x86_64 &, uint32_t *offset) const { | bool compactSaysUseDwarf(Registers_x86_64 &, uint32_t *offset) const { | ||||
if ((_info.format & UNWIND_X86_64_MODE_MASK) == UNWIND_X86_64_MODE_DWARF) { | if ((_info.format & UNWIND_X86_64_MODE_MASK) == UNWIND_X86_64_MODE_DWARF) { | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | #if defined(_LIBUNWIND_TARGET_MIPS_O32) | ||||
} | } | ||||
#endif | #endif | ||||
#if defined(_LIBUNWIND_TARGET_MIPS_NEWABI) | #if defined(_LIBUNWIND_TARGET_MIPS_NEWABI) | ||||
bool compactSaysUseDwarf(Registers_mips_newabi &, uint32_t *) const { | bool compactSaysUseDwarf(Registers_mips_newabi &, uint32_t *) const { | ||||
return true; | return true; | ||||
} | } | ||||
#endif | #endif | ||||
#if defined(_LIBUNWIND_TARGET_SPARC) | |||||
bool compactSaysUseDwarf(Registers_sparc &, uint32_t *) const { return true; } | |||||
#endif | |||||
#endif // defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND) | #endif // defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND) | ||||
#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) | #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) | ||||
compact_unwind_encoding_t dwarfEncoding() const { | compact_unwind_encoding_t dwarfEncoding() const { | ||||
R dummy; | R dummy; | ||||
return dwarfEncoding(dummy); | return dwarfEncoding(dummy); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | #if defined (_LIBUNWIND_TARGET_MIPS_O32) | ||||
} | } | ||||
#endif | #endif | ||||
#if defined (_LIBUNWIND_TARGET_MIPS_NEWABI) | #if defined (_LIBUNWIND_TARGET_MIPS_NEWABI) | ||||
compact_unwind_encoding_t dwarfEncoding(Registers_mips_newabi &) const { | compact_unwind_encoding_t dwarfEncoding(Registers_mips_newabi &) const { | ||||
return 0; | return 0; | ||||
} | } | ||||
#endif | #endif | ||||
#if defined(_LIBUNWIND_TARGET_SPARC) | |||||
compact_unwind_encoding_t dwarfEncoding(Registers_sparc &) const { return 0; } | |||||
#endif | |||||
#endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) | #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) | ||||
#if defined(_LIBUNWIND_SUPPORT_SEH_UNWIND) | #if defined(_LIBUNWIND_SUPPORT_SEH_UNWIND) | ||||
// For runtime environments using SEH unwind data without Windows runtime | // For runtime environments using SEH unwind data without Windows runtime | ||||
// support. | // support. | ||||
pint_t getLastPC() const { /* FIXME: Implement */ return 0; } | pint_t getLastPC() const { /* FIXME: Implement */ return 0; } | ||||
void setLastPC(pint_t pc) { /* FIXME: Implement */ } | void setLastPC(pint_t pc) { /* FIXME: Implement */ } | ||||
RUNTIME_FUNCTION *lookUpSEHUnwindInfo(pint_t pc, pint_t *base) { | RUNTIME_FUNCTION *lookUpSEHUnwindInfo(pint_t pc, pint_t *base) { | ||||
▲ Show 20 Lines • Show All 324 Lines • ▼ Show 20 Lines | if (!foundFDE) { | ||||
// Still not found, do full scan of __eh_frame section. | // Still not found, do full scan of __eh_frame section. | ||||
foundFDE = CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section, | foundFDE = CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section, | ||||
(uint32_t)sects.dwarf_section_length, 0, | (uint32_t)sects.dwarf_section_length, 0, | ||||
&fdeInfo, &cieInfo); | &fdeInfo, &cieInfo); | ||||
} | } | ||||
if (foundFDE) { | if (foundFDE) { | ||||
typename CFI_Parser<A>::PrologInfo prolog; | typename CFI_Parser<A>::PrologInfo prolog; | ||||
if (CFI_Parser<A>::parseFDEInstructions(_addressSpace, fdeInfo, cieInfo, pc, | if (CFI_Parser<A>::parseFDEInstructions(_addressSpace, fdeInfo, cieInfo, pc, | ||||
&prolog)) { | R::getArch(), &prolog)) { | ||||
// Save off parsed FDE info | // Save off parsed FDE info | ||||
_info.start_ip = fdeInfo.pcStart; | _info.start_ip = fdeInfo.pcStart; | ||||
_info.end_ip = fdeInfo.pcEnd; | _info.end_ip = fdeInfo.pcEnd; | ||||
_info.lsda = fdeInfo.lsda; | _info.lsda = fdeInfo.lsda; | ||||
_info.handler = cieInfo.personality; | _info.handler = cieInfo.personality; | ||||
_info.gp = prolog.spExtraArgSize; | _info.gp = prolog.spExtraArgSize; | ||||
_info.flags = 0; | _info.flags = 0; | ||||
_info.format = dwarfEncoding(); | _info.format = dwarfEncoding(); | ||||
▲ Show 20 Lines • Show All 398 Lines • ▼ Show 20 Lines | #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) | ||||
if (cachedFDE != 0) { | if (cachedFDE != 0) { | ||||
CFI_Parser<LocalAddressSpace>::FDE_Info fdeInfo; | CFI_Parser<LocalAddressSpace>::FDE_Info fdeInfo; | ||||
CFI_Parser<LocalAddressSpace>::CIE_Info cieInfo; | CFI_Parser<LocalAddressSpace>::CIE_Info cieInfo; | ||||
const char *msg = CFI_Parser<A>::decodeFDE(_addressSpace, | const char *msg = CFI_Parser<A>::decodeFDE(_addressSpace, | ||||
cachedFDE, &fdeInfo, &cieInfo); | cachedFDE, &fdeInfo, &cieInfo); | ||||
if (msg == NULL) { | if (msg == NULL) { | ||||
typename CFI_Parser<A>::PrologInfo prolog; | typename CFI_Parser<A>::PrologInfo prolog; | ||||
if (CFI_Parser<A>::parseFDEInstructions(_addressSpace, fdeInfo, cieInfo, | if (CFI_Parser<A>::parseFDEInstructions(_addressSpace, fdeInfo, cieInfo, | ||||
pc, &prolog)) { | pc, R::getArch(), &prolog)) { | ||||
// save off parsed FDE info | // save off parsed FDE info | ||||
_info.start_ip = fdeInfo.pcStart; | _info.start_ip = fdeInfo.pcStart; | ||||
_info.end_ip = fdeInfo.pcEnd; | _info.end_ip = fdeInfo.pcEnd; | ||||
_info.lsda = fdeInfo.lsda; | _info.lsda = fdeInfo.lsda; | ||||
_info.handler = cieInfo.personality; | _info.handler = cieInfo.personality; | ||||
_info.gp = prolog.spExtraArgSize; | _info.gp = prolog.spExtraArgSize; | ||||
// Some frameless functions need SP | // Some frameless functions need SP | ||||
// altered when resuming in function. | // altered when resuming in function. | ||||
Show All 12 Lines | #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) | ||||
pint_t fde; | pint_t fde; | ||||
if (_addressSpace.findOtherFDE(pc, fde)) { | if (_addressSpace.findOtherFDE(pc, fde)) { | ||||
CFI_Parser<LocalAddressSpace>::FDE_Info fdeInfo; | CFI_Parser<LocalAddressSpace>::FDE_Info fdeInfo; | ||||
CFI_Parser<LocalAddressSpace>::CIE_Info cieInfo; | CFI_Parser<LocalAddressSpace>::CIE_Info cieInfo; | ||||
if (!CFI_Parser<A>::decodeFDE(_addressSpace, fde, &fdeInfo, &cieInfo)) { | if (!CFI_Parser<A>::decodeFDE(_addressSpace, fde, &fdeInfo, &cieInfo)) { | ||||
// Double check this FDE is for a function that includes the pc. | // Double check this FDE is for a function that includes the pc. | ||||
if ((fdeInfo.pcStart <= pc) && (pc < fdeInfo.pcEnd)) { | if ((fdeInfo.pcStart <= pc) && (pc < fdeInfo.pcEnd)) { | ||||
typename CFI_Parser<A>::PrologInfo prolog; | typename CFI_Parser<A>::PrologInfo prolog; | ||||
if (CFI_Parser<A>::parseFDEInstructions(_addressSpace, fdeInfo, | if (CFI_Parser<A>::parseFDEInstructions(_addressSpace, fdeInfo, cieInfo, | ||||
cieInfo, pc, &prolog)) { | pc, R::getArch(), &prolog)) { | ||||
// save off parsed FDE info | // save off parsed FDE info | ||||
_info.start_ip = fdeInfo.pcStart; | _info.start_ip = fdeInfo.pcStart; | ||||
_info.end_ip = fdeInfo.pcEnd; | _info.end_ip = fdeInfo.pcEnd; | ||||
_info.lsda = fdeInfo.lsda; | _info.lsda = fdeInfo.lsda; | ||||
_info.handler = cieInfo.personality; | _info.handler = cieInfo.personality; | ||||
_info.gp = prolog.spExtraArgSize; | _info.gp = prolog.spExtraArgSize; | ||||
_info.flags = 0; | _info.flags = 0; | ||||
_info.format = dwarfEncoding(); | _info.format = dwarfEncoding(); | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |