[DWARF] Fix DWARFDebugAranges to support 64-bit CU offsets.
authorIgor Kudrin <ikudrin@accesssoftek.com>
Mon, 23 Dec 2019 11:00:55 +0000 (18:00 +0700)
committerIgor Kudrin <ikudrin@accesssoftek.com>
Wed, 15 Jan 2020 10:19:08 +0000 (17:19 +0700)
DWARFContext, the only user of this class, can already handle such offsets.

Differential Revision: https://reviews.llvm.org/D71834

llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp

index 172f1d2c9dbef9d6989ec6a243ee4d5776f0cd48..89b15d2635801905c60479956efa6706e7d0aa8a 100644 (file)
@@ -21,7 +21,7 @@ class DWARFContext;
 class DWARFDebugAranges {
 public:
   void generate(DWARFContext *CTX);
-  uint32_t findAddress(uint64_t Address) const;
+  uint64_t findAddress(uint64_t Address) const;
 
 private:
   void clear();
@@ -33,7 +33,7 @@ private:
 
   struct Range {
     explicit Range(uint64_t LowPC = -1ULL, uint64_t HighPC = -1ULL,
-                   uint32_t CUOffset = -1U)
+                   uint64_t CUOffset = -1ULL)
       : LowPC(LowPC), Length(HighPC - LowPC), CUOffset(CUOffset) {}
 
     void setHighPC(uint64_t HighPC) {
@@ -54,8 +54,8 @@ private:
     }
 
     uint64_t LowPC; /// Start of address range.
-    uint32_t Length; /// End of address range (not including this address).
-    uint32_t CUOffset; /// Offset of the compile unit or die.
+    uint64_t Length; /// End of address range (not including this address).
+    uint64_t CUOffset; /// Offset of the compile unit or die.
   };
 
   struct RangeEndpoint {
index ca6043109cdb862f99edb9242c74f836d1f8c3e8..fa157e86885154474320cb2697e7aa2335e37709 100644 (file)
@@ -113,10 +113,10 @@ void DWARFDebugAranges::construct() {
   Endpoints.shrink_to_fit();
 }
 
-uint32_t DWARFDebugAranges::findAddress(uint64_t Address) const {
+uint64_t DWARFDebugAranges::findAddress(uint64_t Address) const {
   RangeCollIterator It =
       partition_point(Aranges, [=](Range R) { return R.HighPC() <= Address; });
   if (It != Aranges.end() && It->LowPC <= Address)
     return It->CUOffset;
-  return -1U;
+  return -1ULL;
 }