================ @@ -457,34 +456,24 @@ MinidumpParser::FindMemoryRange(lldb::addr_t addr) { } } - // Some Minidumps have a Memory64ListStream that captures all the heap memory - // (full-memory Minidumps). We can't exactly use the same loop as above, - // because the Minidump uses slightly different data structures to describe - // those - - if (!data64.empty()) { - llvm::ArrayRef<MinidumpMemoryDescriptor64> memory64_list; - uint64_t base_rva; - std::tie(memory64_list, base_rva) = - MinidumpMemoryDescriptor64::ParseMemory64List(data64); - - if (memory64_list.empty()) - return std::nullopt; - - for (const auto &memory_desc64 : memory64_list) { - const lldb::addr_t range_start = memory_desc64.start_of_memory_range; - const size_t range_size = memory_desc64.data_size; - - if (base_rva + range_size > GetData().size()) - return std::nullopt; - - if (range_start <= addr && addr < range_start + range_size) { - return minidump::Range(range_start, - GetData().slice(base_rva, range_size)); + if (!GetStream(StreamType::Memory64List).empty()) { + llvm::Error err = llvm::Error::success(); + for (const auto &memory_desc : GetMinidumpFile().getMemory64List(err)) { + // Explicit error check so we can return from within ---------------- labath wrote:
Are you sure that's necessary? If I read [this](https://github.com/llvm/llvm-project/blob/4c77cc634d49782aceff77f7ec4e6183ec223020/llvm/include/llvm/ADT/fallible_iterator.h#L66) right, it shouldn't be. https://github.com/llvm/llvm-project/pull/101086 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits