diff options
Diffstat (limited to 'libunwind/src/UnwindCursor.hpp')
-rw-r--r-- | libunwind/src/UnwindCursor.hpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp index 31be8366d238..f346c720d22c 100644 --- a/libunwind/src/UnwindCursor.hpp +++ b/libunwind/src/UnwindCursor.hpp @@ -1123,6 +1123,12 @@ private: } #endif +#if defined (_LIBUNWIND_TARGET_HEXAGON) + compact_unwind_encoding_t dwarfEncoding(Registers_hexagon &) const { + return 0; + } +#endif + #if defined (_LIBUNWIND_TARGET_MIPS_O32) compact_unwind_encoding_t dwarfEncoding(Registers_mips_o32 &) const { return 0; @@ -1269,7 +1275,7 @@ struct EHABISectionIterator { _Self operator+(size_t a) { _Self out = *this; out._i += a; return out; } _Self operator-(size_t a) { assert(_i >= a); _Self out = *this; out._i -= a; return out; } - size_t operator-(const _Self& other) { return _i - other._i; } + size_t operator-(const _Self& other) const { return _i - other._i; } bool operator==(const _Self& other) const { assert(_addressSpace == other._addressSpace); @@ -1277,6 +1283,12 @@ struct EHABISectionIterator { return _i == other._i; } + bool operator!=(const _Self& other) const { + assert(_addressSpace == other._addressSpace); + assert(_sects == other._sects); + return _i != other._i; + } + typename A::pint_t operator*() const { return functionAddress(); } typename A::pint_t functionAddress() const { @@ -1353,7 +1365,8 @@ bool UnwindCursor<A, R>::getInfoFromEHABISection( // If the high bit is set, the exception handling table entry is inline inside // the index table entry on the second word (aka |indexDataAddr|). Otherwise, - // the table points at an offset in the exception handling table (section 5 EHABI). + // the table points at an offset in the exception handling table (section 5 + // EHABI). pint_t exceptionTableAddr; uint32_t exceptionTableData; bool isSingleWordEHT; @@ -1452,7 +1465,7 @@ bool UnwindCursor<A, R>::getInfoFromEHABISection( _info.unwind_info = exceptionTableAddr; _info.lsda = lsda; // flags is pr_cache.additional. See EHABI #7.2 for definition of bit 0. - _info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0; // Use enum? + _info.flags = (isSingleWordEHT ? 1 : 0) | (scope32 ? 0x2 : 0); // Use enum? return true; } @@ -1847,6 +1860,12 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) { pc &= (pint_t)~0x1; #endif + // Exit early if at the top of the stack. + if (pc == 0) { + _unwindInfoMissing = true; + return; + } + // If the last line of a function is a "throw" the compiler sometimes // emits no instructions after the call to __cxa_throw. This means // the return address is actually the start of the next function. |