diff options
| author | Greg Clayton <gclayton@apple.com> | 2016-02-12 00:07:16 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2016-02-12 00:07:16 +0000 |
| commit | 9ddad935b93906f8b0389b9120ce29ff0206585f (patch) | |
| tree | 20e7bd95dfc0f92db62dfa51812f28febb37d270 /lldb/source | |
| parent | b80a5811ce8f2be21edaf43d408cf63e61f7c9ca (diff) | |
| download | bcm5719-llvm-9ddad935b93906f8b0389b9120ce29ff0206585f.tar.gz bcm5719-llvm-9ddad935b93906f8b0389b9120ce29ff0206585f.zip | |
Don't crash if we have a DIE that has a DW_AT_ranges attribute and yet the SymbolFileDWARF doesn't have a DebugRanges. If this happens print a nice error message to prompt the user to file a bug and attach the offending DWARF file so we can get the correct compiler fixed.
<rdar://problem/24458016>
llvm-svn: 260626
Diffstat (limited to 'lldb/source')
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp index b9d825489ae..1758f3a7946 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -482,11 +482,19 @@ DWARFDebugInfoEntry::GetDIENamesAndRanges case DW_AT_ranges: { const DWARFDebugRanges* debug_ranges = dwarf2Data->DebugRanges(); - debug_ranges->FindRanges(form_value.Unsigned(), ranges); - // All DW_AT_ranges are relative to the base address of the - // compile unit. We add the compile unit base address to make - // sure all the addresses are properly fixed up. - ranges.Slide(cu->GetBaseAddress()); + if (debug_ranges) + { + debug_ranges->FindRanges(form_value.Unsigned(), ranges); + // All DW_AT_ranges are relative to the base address of the + // compile unit. We add the compile unit base address to make + // sure all the addresses are properly fixed up. + ranges.Slide(cu->GetBaseAddress()); + } + else + { + cu->GetSymbolFileDWARF()->GetObjectFile()->GetModule()->ReportError ("{0x%8.8x}: DIE has DW_AT_ranges(0x%" PRIx64 ") attribute yet DWARF has no .debug_ranges, please file a bug and attach the file at the start of this error message", + m_offset, form_value.Unsigned()); + } } break; |

