diff options
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h | 6 | ||||
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp | 13 |
2 files changed, 17 insertions, 2 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h index 4473ce45b47..9591110d15f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h @@ -150,6 +150,12 @@ public: const DWARFDebugAranges & GetFunctionAranges (); + SymbolFileDWARF* + GetSymbolFileDWARF () const + { + return m_dwarf2Data; + } + protected: SymbolFileDWARF* m_dwarf2Data; const DWARFAbbreviationDeclarationSet *m_abbrevs; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp index 7f4a17e2392..26961f497cb 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -124,11 +124,11 @@ DWARFDebugInfoEntry::FastExtract m_parent_idx = 0; m_sibling_idx = 0; m_empty_children = false; - uint64_t abbr_idx = debug_info_data.GetULEB128 (offset_ptr); + const uint64_t abbr_idx = debug_info_data.GetULEB128 (offset_ptr); assert (abbr_idx < (1 << DIE_ABBR_IDX_BITSIZE)); m_abbr_idx = abbr_idx; - assert (fixed_form_sizes); // For best performance this should be specified! + //assert (fixed_form_sizes); // For best performance this should be specified! if (m_abbr_idx) { @@ -136,6 +136,15 @@ DWARFDebugInfoEntry::FastExtract const DWARFAbbreviationDeclaration *abbrevDecl = cu->GetAbbreviations()->GetAbbreviationDeclaration(m_abbr_idx); + if (abbrevDecl == NULL) + { + cu->GetSymbolFileDWARF ()->ReportError ("{0x%8.8x}: invalid abbreviation code %u, please file a bug and attach the file at the start of this error message", + m_offset, + (unsigned)abbr_idx); + // WE can't parse anymore if the DWARF is borked... + *offset_ptr = UINT32_MAX; + return false; + } m_tag = abbrevDecl->Tag(); m_has_children = abbrevDecl->HasChildren(); // Skip all data in the .debug_info for the attributes |

