[Lldb-commits] [lldb] [llvm] [Obj2Yaml] Add support for minidump generation with 64b memory ranges. (PR #101272)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 8 01:08:35 PDT 2024


================
@@ -154,3 +155,50 @@ MinidumpFile::create(MemoryBufferRef Source) {
   return std::unique_ptr<MinidumpFile>(
       new MinidumpFile(Source, Hdr, *ExpectedStreams, std::move(StreamMap)));
 }
+
+static iterator_range<MinidumpFile::FallibleMemory64Iterator>
+makeEmptyRange(Error &Err) {
+  return make_range(
+      llvm::object::MinidumpFile::FallibleMemory64Iterator::itr(
+          llvm::object::MinidumpFile::Memory64Iterator::end(), Err),
+      llvm::object::MinidumpFile::FallibleMemory64Iterator::end(
+          llvm::object::MinidumpFile::Memory64Iterator::end()));
----------------
labath wrote:

```suggestion
  return make_fallible_range(
       Memory64Iterator::end(),
       Memory64Iterator::end(), Err);
```

.. although the way I'd probably do it is to delete this function, put an `auto end = make_fallible_end(Memory64Iterator::end())` at the beginning of the `getMemory64List` function, and then do a `return make_range(end, end)` on the error paths.

https://github.com/llvm/llvm-project/pull/101272


More information about the lldb-commits mailing list