GP-4347: PeLoader now pads initialized memory blocks with 0 instead of

creating an additional uninitialized block. Also improved Bytes Source
column of Memory Map.
This commit is contained in:
Ryan Kurtz 2024-02-22 07:33:45 -05:00
parent 5690528835
commit f9ce96fd6d
9 changed files with 35 additions and 21 deletions

View file

@ -179,7 +179,7 @@ class BitMappedSubMemoryBlock extends SubMemoryBlock {
@Override
protected String getDescription() {
return "Bit Mapped: " + mappedAddress;
return "bitmap[0x%x, 0x%x, %s]".formatted(subBlockOffset, subBlockLength, mappedAddress);
}
}

View file

@ -117,6 +117,6 @@ class BufferSubMemoryBlock extends SubMemoryBlock {
@Override
protected String getDescription() {
return "";
return "init[0x%x]".formatted(subBlockLength);
}
}

View file

@ -199,7 +199,7 @@ class ByteMappedSubMemoryBlock extends SubMemoryBlock {
@Override
protected String getDescription() {
return "Byte Mapped: " + mappedAddress + ", " + byteMappingScheme;
return "bytemap[0x%x, 0x%x, %s]".formatted(subBlockOffset, subBlockLength, mappedAddress);
}
}

View file

@ -112,10 +112,8 @@ class FileBytesSubMemoryBlock extends SubMemoryBlock {
@Override
protected String getDescription() {
String fileName = fileBytes.getFilename();
String hexString = Long.toHexString(fileBytesOffset + fileBytes.getFileOffset());
return "File: " + fileName + ": 0x" + hexString;
return "%s[0x%x, 0x%x]".formatted(fileBytes.getFilename(),
fileBytesOffset + fileBytes.getFileOffset(), subBlockLength);
}
@Override

View file

@ -86,7 +86,6 @@ class UninitializedSubMemoryBlock extends SubMemoryBlock {
@Override
protected String getDescription() {
return "";
return "uninit[0x%x]".formatted(subBlockLength);
}
}