[lldb] [llvm] [Obj2Yaml] Add support for minidump generation with 64b memory ranges. (PR #101272)
    Pavel Labath via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Aug  5 02:05:41 PDT 2024
    
    
  
================
@@ -132,6 +140,71 @@ class MinidumpFile : public Binary {
     size_t Stride;
   };
 
+  class Memory64ListFacade {
+    struct Memory64Iterator {
+    public:
+      Memory64Iterator(size_t Count, uint64_t BaseRVA,
+                       const Memory64ListFacade *Parent)
+          : Parent(Parent), BaseRVA(BaseRVA), Count(Count) {};
+
+      const std::pair<minidump::MemoryDescriptor_64, ArrayRef<uint8_t>>
+      operator*() {
+        return Parent->Next(this);
+      }
+
+      bool operator==(const Memory64Iterator &R) const {
+        return Parent == R.Parent && Count == R.Count;
+      }
+
+      bool operator!=(const Memory64Iterator &R) const { return !(*this == R); }
+
+    private:
+      friend class Memory64ListFacade;
+      const Memory64ListFacade *Parent;
+      uint64_t BaseRVA;
+      size_t Count;
+    };
+
+  public:
+    Memory64ListFacade(ArrayRef<uint8_t> Storage,
+                       std::vector<minidump::MemoryDescriptor_64> Descriptors,
----------------
labath wrote:
I don't think this needs to be a vector. The memory for these is held by the MinidumpFile object, right?
https://github.com/llvm/llvm-project/pull/101272
    
    
More information about the llvm-commits
mailing list