[llvm-branch-commits] [lldb] r270122 - 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.
Francis Ricci via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu May 19 13:50:21 PDT 2016
Author: fjricci
Date: Thu May 19 15:50:21 2016
New Revision: 270122
URL: http://llvm.org/viewvc/llvm-project?rev=270122&view=rev
Log:
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.
Author: Greg Clayton <gclayton at apple.com>
Date: Fri Mar 18 20:33:49 2016 +0000
This is a cherry-pick of r263824
Modified:
lldb/branches/release_38/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Modified: lldb/branches/release_38/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=270122&r1=270121&r2=270122&view=diff
==============================================================================
--- lldb/branches/release_38/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/branches/release_38/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Thu May 19 15:50:21 2016
@@ -4120,44 +4120,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);
+ 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)
+ // 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
{
- const DWARFRangeList::Entry& range = dwarf_scope_ranges.GetEntryRef(i);
- scope_ranges.Append(range.GetRangeBase() + die.GetCU()->GetBaseAddress(),
- range.GetByteSize());
+ // 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:
More information about the llvm-branch-commits
mailing list