use of com.ibm.j9ddr.corereaders.memory.DumpMemorySource in project openj9 by eclipse.
the class Memory64Stream method readFrom.
public void readFrom(MiniDumpReader dump) throws IOException {
long location = getLocation();
dump.seek(location);
long numberOfMemoryRanges = dump.readLong();
long baseAddress = dump.readLong();
List<IMemorySource> memorySources = new ArrayList<IMemorySource>();
DumpMemorySource memoryRange = null;
for (int i = 0; i < numberOfMemoryRanges; i++) {
long start = dump.is64Bit() ? dump.readLong() : dump.readLong() & 0x00000000FFFFFFFFL;
long size = dump.is64Bit() ? dump.readLong() : dump.readLong() & 0x00000000FFFFFFFFL;
if (null == memoryRange) {
// Allocate the first memory range starting at baseAddress in
// the dump file
memoryRange = new DumpMemorySource(start, size, baseAddress, dump, false, false, true);
} else if (memoryRange.getBaseAddress() + memoryRange.getSize() == start) {
// Combine contiguous regions
memoryRange = new DumpMemorySource(memoryRange.getBaseAddress(), memoryRange.getSize() + size, memoryRange.getFileOffset(), dump, false, false, true);
} else {
// Add the previous MemoryRange and start the next one
memorySources.add(memoryRange);
memoryRange = new DumpMemorySource(start, size, memoryRange.getFileOffset() + memoryRange.getSize(), dump, false, false, true);
}
// public DumpMemoryRange(long baseAddress, long size, long
// fileOffset, AbstractCoreReader reader)
}
if (null != memoryRange) {
memorySources.add(memoryRange);
}
dump.setMemorySources(memorySources);
}
Aggregations