diff options
| author | Pavel Labath <labath@google.com> | 2017-05-25 13:13:12 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-05-25 13:13:12 +0000 |
| commit | e8cd2cca91bb6fe7cf0b40d4640605d4116f8bef (patch) | |
| tree | d59a895ff31b4e417f8c0be934f15dfe53662376 | |
| parent | 2a237f19f1158a46d298dcb888128378c8a132d8 (diff) | |
| download | llvm-e8cd2cca91bb6fe7cf0b40d4640605d4116f8bef.zip llvm-e8cd2cca91bb6fe7cf0b40d4640605d4116f8bef.tar.gz llvm-e8cd2cca91bb6fe7cf0b40d4640605d4116f8bef.tar.bz2 | |
Revert "Fix FDE indexing while scan debug_info section."
This reverts commit r303847 as it introduces a number of regressions.
Investigation has showed that we are parsing the CIE entries in the
debug_frame section incorrectly -- we are parsing them the same way as
eh_frame, but the entries in debug_frame have a couple of extra entries
which have not been taken into account.
llvm-svn: 303854
| -rw-r--r-- | lldb/source/Symbol/DWARFCallFrameInfo.cpp | 31 | ||||
| -rw-r--r-- | lldb/source/Symbol/UnwindTable.cpp | 7 |
2 files changed, 11 insertions, 27 deletions
diff --git a/lldb/source/Symbol/DWARFCallFrameInfo.cpp b/lldb/source/Symbol/DWARFCallFrameInfo.cpp index df8a8cf..015ecd856 100644 --- a/lldb/source/Symbol/DWARFCallFrameInfo.cpp +++ b/lldb/source/Symbol/DWARFCallFrameInfo.cpp @@ -461,25 +461,11 @@ void DWARFCallFrameInfo::GetFDEIndex() { m_fde_index_initialized = true; return; } - - // An FDE entry contains CIE_pointer in debug_frame in same place as cie_id - // in eh_frame. CIE_pointer is an offset into the .debug_frame section. - // So, variable cie_offset should be equal cie_id for debug_frame. - // FDE entries with cie_id == 0 shouldn't be ignored for it. - if ((cie_id == 0 && m_is_eh_frame) || cie_id == UINT32_MAX || len == 0) { - m_cie_map[current_entry] = ParseCIE(current_entry); - offset = next_entry; - continue; - } - - if (!m_is_eh_frame) - cie_offset = cie_id; - if (cie_offset > m_cfi_data.GetByteSize()) { - Host::SystemLog(Host::eSystemLogError, - "error: Invalid cie offset of 0x%x " - "found in cie/fde at 0x%x\n", - cie_offset, current_entry); + Host::SystemLog( + Host::eSystemLogError, + "error: Invalid cie offset of 0x%x found in cie/fde at 0x%x\n", + cie_offset, current_entry); // Don't trust anything in this eh_frame section if we find blatantly // invalid data. m_fde_index.Clear(); @@ -487,6 +473,12 @@ void DWARFCallFrameInfo::GetFDEIndex() { return; } + if (cie_id == 0 || cie_id == UINT32_MAX || len == 0) { + m_cie_map[current_entry] = ParseCIE(current_entry); + offset = next_entry; + continue; + } + const CIE *cie = GetCIE(cie_offset); if (cie) { const lldb::addr_t pc_rel_addr = m_section_sp->GetFileAddress(); @@ -539,8 +531,7 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset, cie_offset = m_cfi_data.GetU32(&offset); } - // FDE entries with zero cie_offset may occur for debug_frame. - assert(!(m_is_eh_frame && 0 == cie_offset) && cie_offset != UINT32_MAX); + assert(cie_offset != 0 && cie_offset != UINT32_MAX); // Translate the CIE_id from the eh_frame format, which // is relative to the FDE offset, into a __eh_frame section diff --git a/lldb/source/Symbol/UnwindTable.cpp b/lldb/source/Symbol/UnwindTable.cpp index f417f35..336f0c3 100644 --- a/lldb/source/Symbol/UnwindTable.cpp +++ b/lldb/source/Symbol/UnwindTable.cpp @@ -51,13 +51,6 @@ void UnwindTable::Initialize() { if (sect.get()) { m_eh_frame_up.reset(new DWARFCallFrameInfo(m_object_file, sect, eRegisterKindEHFrame, true)); - } else { - // Try to find .debug_frame section if .eh_frame doesn't exist. - sect = sl->FindSectionByType(eSectionTypeDWARFDebugFrame, true); - if (sect.get()) { - m_eh_frame_up.reset(new DWARFCallFrameInfo(m_object_file, sect, - eRegisterKindDWARF, false)); - } } sect = sl->FindSectionByType(eSectionTypeCompactUnwind, true); if (sect.get()) { |
