public void InitFromMemoryList() { _memoryList = new MinidumpMemoryList(_dumpStream); uint count = _memoryList.Count; MINIDUMP_MEMORY_DESCRIPTOR tempMD; List <MinidumpMemoryChunk> chunks = new List <MinidumpMemoryChunk>(); for (ulong i = 0; i < count; i++) { MinidumpMemoryChunk chunk = new MinidumpMemoryChunk(); tempMD = _memoryList.GetElement((uint)i); if (tempMD.Memory.DataSize > 0) { chunk.Size = tempMD.Memory.DataSize; chunk.TargetStartAddress = tempMD.StartOfMemoryRange; chunk.TargetEndAddress = tempMD.StartOfMemoryRange + tempMD.Memory.DataSize; chunk.RVA = tempMD.Memory.Rva.Value; chunks.Add(chunk); } } chunks.Sort(); SplitAndMergeChunks(chunks); _chunks = chunks.ToArray(); Count = (ulong)chunks.Count; ValidateChunks(); }
public MinidumpMemoryChunks(DumpPointer rawStream, MINIDUMP_STREAM_TYPE type) { Count = 0; _memory64List = null; _memoryList = null; _listType = MINIDUMP_STREAM_TYPE.UnusedStream; if (type != MINIDUMP_STREAM_TYPE.MemoryListStream && type != MINIDUMP_STREAM_TYPE.Memory64ListStream) { throw new ClrDiagnosticsException("Type must be either MemoryListStream or Memory64ListStream", ClrDiagnosticsExceptionKind.CrashDumpError); } _listType = type; _dumpStream = rawStream; if (MINIDUMP_STREAM_TYPE.Memory64ListStream == type) { InitFromMemory64List(); } else { InitFromMemoryList(); } }