diff options
author | Christopher Ferris <cferris@google.com> | 2018-01-24 08:52:47 -0800 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2018-01-24 13:20:03 -0800 |
commit | 2e8c6e26e6a66186b3350a99d394a9deebd57fe9 (patch) | |
tree | 7d7f52e2461a6409057c61c4770c5b825af737ec /libunwindstack/DwarfEhFrameWithHdr.cpp | |
parent | c0e01d629de69f7ea5f10a98346dd4560e4fa688 (diff) | |
download | unwinding-2e8c6e26e6a66186b3350a99d394a9deebd57fe9.tar.gz |
Small behavioral changes to the unwinder.
- Be a little more lenient when reading the cies/fdes. If next entry data
winds up incorrect, don't fail, simply stop processing the entries. This
only applies when reading all of the cies/fdes at once.
- Fail to init an eh_frame with no entries and fallback to assuming the
eh_frame has no header instead.
- Change the step to always try debug_frame first which has the most
accurate information.
- Add small unit tests and a couple of offline unit tests to verify
this behavior.
These changes are needed to support offline unwinding since it depends
on this new behavior.
Bug: 65682279
Test: Ran new unit tests.
Change-Id: I3529f1b0c8e14cd7409494e5de2f3c9e78d0855e
Diffstat (limited to 'libunwindstack/DwarfEhFrameWithHdr.cpp')
-rw-r--r-- | libunwindstack/DwarfEhFrameWithHdr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libunwindstack/DwarfEhFrameWithHdr.cpp b/libunwindstack/DwarfEhFrameWithHdr.cpp index 0337dba..e0f1eed 100644 --- a/libunwindstack/DwarfEhFrameWithHdr.cpp +++ b/libunwindstack/DwarfEhFrameWithHdr.cpp @@ -64,6 +64,11 @@ bool DwarfEhFrameWithHdr<AddressType>::Init(uint64_t offset, uint64_t size) { return false; } + if (fde_count_ == 0) { + last_error_ = DWARF_ERROR_NO_FDES; + return false; + } + entries_offset_ = memory_.cur_offset(); entries_end_ = offset + size; entries_data_offset_ = offset; |