diff options
| author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2017-07-31 17:02:52 +0000 |
|---|---|---|
| committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2017-07-31 17:02:52 +0000 |
| commit | b14f1da23c9bd35e44f44c30d40ff2da1a0febed (patch) | |
| tree | bd6797e9177a7c0dd9a2cf132b59e12fb038f34d /lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | |
| parent | 02c602e18c5a591ee6b76c214983b304706afa07 (diff) | |
| download | bcm5719-llvm-b14f1da23c9bd35e44f44c30d40ff2da1a0febed.tar.gz bcm5719-llvm-b14f1da23c9bd35e44f44c30d40ff2da1a0febed.zip | |
Fix LLDB crash accessing unknown DW_FORM_* attributes
Current LLDB (that is without DWZ support) crashes accessing Fedora debug info:
READ of size 8 at 0x60200000ffc8 thread T0
#0 in DWARFDebugInfoEntry::BuildAddressRangeTable(SymbolFileDWARF*, DWARFCompileUnit const*, DWARFDebugAranges*) const tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:1336
Greg Clayton: We will need a warning to be emitted in
SymbolFileDWARF::CalculateAbilities() stating we won't parse the DWARF due to
"unsupported DW_FORM value of 0x1f20".
Patch has been mostly written by Greg Clayton.
Differential revision: https://reviews.llvm.org/D35622
llvm-svn: 309581
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp')
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 7a4d894af10..82d68574c49 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -532,6 +532,20 @@ uint32_t SymbolFileDWARF::CalculateAbilities() { if (section) debug_abbrev_file_size = section->GetFileSize(); + DWARFDebugAbbrev *abbrev = DebugAbbrev(); + if (abbrev) { + std::set<dw_form_t> invalid_forms; + abbrev->GetUnsupportedForms(invalid_forms); + if (!invalid_forms.empty()) { + StreamString error; + error.Printf("unsupported DW_FORM value%s:", invalid_forms.size() > 1 ? "s" : ""); + for (auto form : invalid_forms) + error.Printf(" %#x", form); + m_obj_file->GetModule()->ReportWarning("%s", error.GetString().str().c_str()); + return 0; + } + } + section = section_list->FindSectionByType(eSectionTypeDWARFDebugLine, true) .get(); |

