summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2016-03-18 20:33:49 +0000
committerGreg Clayton <gclayton@apple.com>2016-03-18 20:33:49 +0000
commit31460392c1ae69af903d381cf7d6d2280eea94a3 (patch)
tree3b7860fb4fe2330e071a85947c4cc29f67599766 /lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
parentfa771811b3cf146ce0cadd1995d149ed50acc96d (diff)
downloadbcm5719-llvm-31460392c1ae69af903d381cf7d6d2280eea94a3.tar.gz
bcm5719-llvm-31460392c1ae69af903d381cf7d6d2280eea94a3.zip
Fixed a bug where DW_AT_start_scope would fall through to DW_AT_artificial in SymbolFileDWARF::ParseVariableDIE(). This was caught by the clang warning that catches unannotated case fall throughs.
llvm-svn: 263824
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp65
1 files changed, 33 insertions, 32 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 4446d95ef98..842575fab2e 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -4200,44 +4200,45 @@ SymbolFileDWARF::ParseVariableDIE
}
break;
case DW_AT_specification:
- {
- DWARFDebugInfo* debug_info = DebugInfo();
- if (debug_info)
- spec_die = debug_info->GetDIE(DIERef(form_value));
+ {
+ DWARFDebugInfo* debug_info = DebugInfo();
+ if (debug_info)
+ spec_die = debug_info->GetDIE(DIERef(form_value));
+ }
break;
- }
case DW_AT_start_scope:
- {
- if (form_value.Form() == DW_FORM_sec_offset)
{
- DWARFRangeList dwarf_scope_ranges;
- const DWARFDebugRanges* debug_ranges = DebugRanges();
- debug_ranges->FindRanges(form_value.Unsigned(), dwarf_scope_ranges);
-
- // All DW_AT_start_scope 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.
- for (size_t i = 0, count = dwarf_scope_ranges.GetSize(); i < count; ++i)
+ if (form_value.Form() == DW_FORM_sec_offset)
{
- const DWARFRangeList::Entry& range = dwarf_scope_ranges.GetEntryRef(i);
- scope_ranges.Append(range.GetRangeBase() + die.GetCU()->GetBaseAddress(),
- range.GetByteSize());
+ DWARFRangeList dwarf_scope_ranges;
+ const DWARFDebugRanges* debug_ranges = DebugRanges();
+ debug_ranges->FindRanges(form_value.Unsigned(), dwarf_scope_ranges);
+
+ // All DW_AT_start_scope 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.
+ for (size_t i = 0, count = dwarf_scope_ranges.GetSize(); i < count; ++i)
+ {
+ const DWARFRangeList::Entry& range = dwarf_scope_ranges.GetEntryRef(i);
+ scope_ranges.Append(range.GetRangeBase() + die.GetCU()->GetBaseAddress(),
+ range.GetByteSize());
+ }
+ }
+ else
+ {
+ // TODO: Handle the case when DW_AT_start_scope have form constant. The
+ // dwarf spec is a bit ambiguous about what is the expected behavior in
+ // case the enclosing block have a non coninious address range and the
+ // DW_AT_start_scope entry have a form constant.
+ GetObjectFile()->GetModule()->ReportWarning ("0x%8.8" PRIx64 ": DW_AT_start_scope has unsupported form type (0x%x)\n",
+ die.GetID(),
+ form_value.Form());
}
- }
- else
- {
- // TODO: Handle the case when DW_AT_start_scope have form constant. The
- // dwarf spec is a bit ambiguous about what is the expected behavior in
- // case the enclosing block have a non coninious address range and the
- // DW_AT_start_scope entry have a form constant.
- GetObjectFile()->GetModule()->ReportWarning ("0x%8.8" PRIx64 ": DW_AT_start_scope has unsupported form type (0x%x)\n",
- die.GetID(),
- form_value.Form());
- }
- scope_ranges.Sort();
- scope_ranges.CombineConsecutiveRanges();
- }
+ scope_ranges.Sort();
+ scope_ranges.CombineConsecutiveRanges();
+ }
+ break;
case DW_AT_artificial: is_artificial = form_value.Boolean(); break;
case DW_AT_accessibility: break; //accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
case DW_AT_declaration:
OpenPOWER on IntegriCloud