================
@@ -132,6 +140,79 @@ class MinidumpFile : public Binary {
     size_t Stride;
   };
 
+class Memory64Iterator {
+  public:
+    static Memory64Iterator begin(ArrayRef<uint8_t> Storage, 
ArrayRef<minidump::MemoryDescriptor_64> Descriptors, uint64_t BaseRVA) {
+      return Memory64Iterator(Storage, Descriptors, BaseRVA);
+    }
+
+    static Memory64Iterator end() {
+      return Memory64Iterator();
+    }
+
+    std::pair<minidump::MemoryDescriptor_64, ArrayRef<uint8_t>> Current;
+
+    bool operator==(const Memory64Iterator &R) const {
+      return isEnd == R.isEnd;
+    }
+
+    bool operator!=(const Memory64Iterator &R) const { return !(*this == R); }
+
+    const std::pair<minidump::MemoryDescriptor_64, ArrayRef<uint8_t>> 
&operator*() const {
+      return Current;
+    }
+
+    const std::pair<minidump::MemoryDescriptor_64, ArrayRef<uint8_t>> 
*operator->() const {
+      return &Current;
+    }
+
+    Error inc() {
+      if (Storage.size() == 0 || Descriptors.size() == 0)
----------------
Jlalond wrote:

@labath This is my last concern. I tried to base this off of `Archive.cpp`'s 
implementation of Fallible iterator, but if the iterator is dereferenced before 
being advanced we'll get a default value of {0, 0}.

Currently you just have to use the `++It` operator in both classes, but I'm not 
sure if this is best practice.

https://github.com/llvm/llvm-project/pull/101272
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to