aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/DWARFUnit.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-06-13 22:31:03 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-06-13 22:31:03 +0000
commitaa90998c878fc4ab4c1e8bd9805557cb98a06623 (patch)
tree24f3e1befbd7708a991d657d96d213b6df249ef5 /llvm/lib/DebugInfo/DWARFUnit.cpp
parentbe7c677008f7e9a59470536fe29e9b19f5d27eb1 (diff)
downloadllvm-aa90998c878fc4ab4c1e8bd9805557cb98a06623.zip
llvm-aa90998c878fc4ab4c1e8bd9805557cb98a06623.tar.gz
llvm-aa90998c878fc4ab4c1e8bd9805557cb98a06623.tar.bz2
[DWARF parser] Use distinction between DW_AT_ranges_base and DW_AT_GNU_ranges_base instead of DWARF version
llvm-svn: 210945
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFUnit.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARFUnit.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARFUnit.cpp
index 0278277..39d0a0f 100644
--- a/llvm/lib/DebugInfo/DWARFUnit.cpp
+++ b/llvm/lib/DebugInfo/DWARFUnit.cpp
@@ -225,12 +225,10 @@ size_t DWARFUnit::extractDIEsIfNeeded(bool CUDieOnly) {
setBaseAddress(BaseAddr);
AddrOffsetSectionBase = DieArray[0].getAttributeValueAsSectionOffset(
this, DW_AT_GNU_addr_base, 0);
- // Users of old DWARF may not know about DW_AT_ranges_base, so it is ignored
- // for skeleton CU DIE (e.g. DW_AT_ranges are *not* relative to it).
- if (Version > 4) {
- RangeSectionBase = DieArray[0].getAttributeValueAsSectionOffset(
- this, DW_AT_GNU_ranges_base, 0);
- }
+ RangeSectionBase = DieArray[0].getAttributeValueAsSectionOffset(
+ this, DW_AT_ranges_base, 0);
+ // Don't fall back to DW_AT_GNU_ranges_base: it should be ignored for
+ // skeleton CU DIE, so that DWARF users not aware of it are not broken.
}
setDIERelations();
@@ -276,8 +274,7 @@ bool DWARFUnit::parseDWO() {
}
// Share .debug_addr and .debug_ranges section with compile unit in .dwo
DWOCU->setAddrOffsetSection(AddrOffsetSection, AddrOffsetSectionBase);
- uint32_t DWORangesBase = DieArray[0].getAttributeValueAsSectionOffset(
- this, DW_AT_GNU_ranges_base, 0);
+ uint32_t DWORangesBase = DieArray[0].getRangesBaseAttribute(this, 0);
DWOCU->setRangesSection(RangeSection, DWORangesBase);
return true;
}