[PATCH] D71834: [DWARF] Fix DWARFDebugAranges to support 64-bit CU offsets.

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 23 04:21:49 PST 2019


ikudrin created this revision.
ikudrin added reviewers: probinson, aprantl, samsonov, dblaikie.
ikudrin added projects: debug-info, LLVM.
Herald added a subscriber: hiraditya.

DWARFContext, the only user of this class, already can handle such offsets.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71834

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


Index: llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp
@@ -113,7 +113,7 @@
   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)
Index: llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
===================================================================
--- llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
+++ llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
@@ -21,7 +21,7 @@
 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 @@
 
   struct Range {
     explicit Range(uint64_t LowPC = -1ULL, uint64_t HighPC = -1ULL,
-                   uint32_t CUOffset = -1U)
+                   uint64_t CUOffset = -1U)
       : LowPC(LowPC), Length(HighPC - LowPC), CUOffset(CUOffset) {}
 
     void setHighPC(uint64_t HighPC) {
@@ -54,8 +54,8 @@
     }
 
     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 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71834.235125.patch
Type: text/x-patch
Size: 1732 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191223/6fde94f8/attachment.bin>


More information about the llvm-commits mailing list