================
@@ -494,6 +528,32 @@ Stream::create(const Directory &StreamDesc, const 
object::MinidumpFile &File) {
     }
     return std::make_unique<MemoryListStream>(std::move(Ranges));
   }
+  case StreamKind::Memory64List: {
+    // Error, unlike expected is true in failure state
+    Error Err = Error::success();
+    // Explicit check on Err so that if we return due to getmemory64list
+    // getting an error, it's not destructed when unchecked.
+    if (Err)
+      return Err;
+    auto ExpectedList = File.getMemory64List(Err);
+    if (!ExpectedList)
+      return ExpectedList.takeError();
+    std::vector<Memory64ListStream::entry_type> Ranges;
+    for (auto It = ExpectedList->begin(); It != ExpectedList->end(); ++It) {
----------------
labath wrote:

It should be possible to use a range based for to implement this loop, and the 
fact that you needed to check the error inside the loop makes me suspect there 
is something wrong with the loop termination condition. Maybe you need to 
explicitly set the iterator to the "end" state so that this condition fires?
```
  friend bool operator==(const fallible_iterator &LHS,
                         const fallible_iterator &RHS) {
    // If both iterators are in the end state they compare
    // equal, regardless of whether either is valid.
    if (LHS.isEnd() && RHS.isEnd())
      return true;
```

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