[lldb] [llvm] [LLDB][Minidump] Fix ProcessMinidump::GetMemoryRegions to include 64b regions when /proc/pid maps are missing. (PR #101086)

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 17:49:53 PDT 2024


================
@@ -154,3 +155,17 @@ MinidumpFile::create(MemoryBufferRef Source) {
   return std::unique_ptr<MinidumpFile>(
       new MinidumpFile(Source, Hdr, *ExpectedStreams, std::move(StreamMap)));
 }
+
+Expected<ArrayRef<MemoryDescriptor_64>> MinidumpFile::getMemory64List() const {
+  Expected<minidump::Memory64ListHeader> MemoryList64 = getMemoryList64Header();
+  if (!MemoryList64)
+    return MemoryList64.takeError();
+
+  std::optional<ArrayRef<uint8_t>> Stream =
+      getRawStream(StreamType::Memory64List);
+  if (!Stream)
+    return createError("No such stream");
+
+  return getDataSliceAs<minidump::MemoryDescriptor_64>(
----------------
clayborg wrote:

This gets just a single memory descriptor and it needs to be an array. There should be a test for this to ensure we can load multiple 64 bit ranges where you use your YAML to produce a small core file with only a few memory ranges that are in the MemoryDescriptor_64 formats and verify we can read the data.

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


More information about the llvm-commits mailing list