summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2017-07-31 17:02:52 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2017-07-31 17:02:52 +0000
commitb14f1da23c9bd35e44f44c30d40ff2da1a0febed (patch)
treebd6797e9177a7c0dd9a2cf132b59e12fb038f34d /lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
parent02c602e18c5a591ee6b76c214983b304706afa07 (diff)
downloadbcm5719-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/DWARFDebugAbbrev.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
index d681925daea..1cf0e7eeeb6 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
@@ -98,6 +98,21 @@ dw_uleb128_t DWARFAbbreviationDeclarationSet::AppendAbbrevDeclSequential(
}
//----------------------------------------------------------------------
+// DWARFAbbreviationDeclarationSet::GetUnsupportedForms()
+//----------------------------------------------------------------------
+void DWARFAbbreviationDeclarationSet::GetUnsupportedForms(
+ std::set<dw_form_t> &invalid_forms) const {
+ for (const auto &abbr_decl : m_decls) {
+ const size_t num_attrs = abbr_decl.NumAttributes();
+ for (size_t i=0; i<num_attrs; ++i) {
+ dw_form_t form = abbr_decl.GetFormByIndex(i);
+ if (!DWARFFormValue::FormIsSupported(form))
+ invalid_forms.insert(form);
+ }
+ }
+}
+
+//----------------------------------------------------------------------
// Encode
//
// Encode the abbreviation table onto the end of the buffer provided
@@ -175,3 +190,12 @@ DWARFDebugAbbrev::GetAbbreviationDeclarationSet(
return &(pos->second);
return NULL;
}
+
+//----------------------------------------------------------------------
+// DWARFDebugAbbrev::GetUnsupportedForms()
+//----------------------------------------------------------------------
+void DWARFDebugAbbrev::GetUnsupportedForms(
+ std::set<dw_form_t> &invalid_forms) const {
+ for (const auto &pair : m_abbrevCollMap)
+ pair.second.GetUnsupportedForms(invalid_forms);
+}
OpenPOWER on IntegriCloud