Module openj9.dtfj
Class MutableAddressSpace
java.lang.Object
com.ibm.j9ddr.corereaders.tdump.zebedee.dumpreader.AddressSpace
com.ibm.j9ddr.corereaders.tdump.zebedee.dumpreader.MutableAddressSpace
- All Implemented Interfaces:
Emulator.ImageSpace
,Serializable
Provides the ability to write as well as read to a copy of the address space. This class
is provided for use by the
Emulator
.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected long
The last mutable block address requested (quick block cache)Fields declared in class com.ibm.j9ddr.corereaders.tdump.zebedee.dumpreader.AddressSpace
addressMap, asid, dump, lastBlockAddress, lastButOneBlockAddress, ranges, WILD_POINTER
-
Constructor Summary
ConstructorsConstructorDescriptionMutableAddressSpace
(AddressSpace space) Creates a new MutableAddressSpace from the given AddressSpace. -
Method Summary
Modifier and TypeMethodDescriptionvoid
allocPage
(long address) Allocate a page of memory at the given address.void
free
(long ptr) Free the memory that was previously allocated by malloc.protected byte[]
getBlockFromCacheOrDisk
(long address) Get the block of bytes for the given address.long
malloc
(int size) Allocate a chunk of unused memory.long
rmalloc
(int size) void
writeByte
(long address, int value) Write a byte at the specified address.void
writeBytes
(long address, byte[] array) Write the contents of the byte array to the specified address.void
writeInt
(long address, int value) Write an int at the specified address.void
writeLong
(long address, long value) Write a long at the specified address.void
writeShort
(long address, int value) Write a short at the specified address.void
writeWord
(long address, long value) Write a word at the specified address.Methods declared in class com.ibm.j9ddr.corereaders.tdump.zebedee.dumpreader.AddressSpace
getAddressRanges, getAsid, getBlock, getDump, getImageInputStream, getLowestAddress, getRootAddressSpace, getUnusedAddressRanges, getUserMap, getWordLength, is64bit, isValidAddress, read, read, readAsciiCString, readAsciiString, readAsciiString, readByte, readEbcdicCString, readEbcdicString, readEbcdicString, readInt, readLong, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUtf8String, readWord, readWord, roundToPage, setIs64bit, toString
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods declared in interface com.ibm.j9ddr.corereaders.tdump.zebedee.util.Emulator.ImageSpace
is64bit, readInt, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort
-
Field Details
-
lastMutableBlockAddress
protected long lastMutableBlockAddressThe last mutable block address requested (quick block cache)
-
-
Constructor Details
-
MutableAddressSpace
Creates a new MutableAddressSpace from the given AddressSpace. Updates to this "forked" copy will not be reflected in the parent AddressSpace.- Parameters:
AddressSpace
- the address space we read from
-
-
Method Details
-
getBlockFromCacheOrDisk
Get the block of bytes for the given address. We look first in our own cache and if its not there call the superclass method.- Overrides:
getBlockFromCacheOrDisk
in classAddressSpace
- Throws:
IOException
-
writeBytes
Write the contents of the byte array to the specified address.- Throws:
IOException
- if the given address (of offset from there) is not present in this address space
-
writeWord
Write a word at the specified address. A word is either 32 or 64 bits depending on the machine context.- Throws:
IOException
-
writeByte
Write a byte at the specified address.- Specified by:
writeByte
in interfaceEmulator.ImageSpace
- Throws:
IOException
- if the given address is not present in this address space
-
writeShort
Write a short at the specified address.- Specified by:
writeShort
in interfaceEmulator.ImageSpace
- Throws:
IOException
- if the given address is not present in this address space
-
writeInt
Write an int at the specified address.- Specified by:
writeInt
in interfaceEmulator.ImageSpace
- Throws:
IOException
- if the given address is not present in this address space
-
writeLong
Write a long at the specified address.- Specified by:
writeLong
in interfaceEmulator.ImageSpace
- Throws:
IOException
- if the given address is not present in this address space
-
malloc
Allocate a chunk of unused memory. This searches the known address ranges and tries to find an unallocated area of the given size. If successful, this area effectively becomes part of this ImageSpace and may be read and written to as normal. This method is used by users of the Emulator for things like allocating stack, arguments etc.- Specified by:
malloc
in interfaceEmulator.ImageSpace
- Returns:
- the address of the allocated memory
- Throws:
IOException
-
rmalloc
- Throws:
IOException
-
free
Free the memory that was previously allocated by malloc.- Throws:
IOException
-
allocPage
Allocate a page of memory at the given address. The address must not already be in use. A page is 4096 bytes in length. Address must be on a page boundary.- Throws:
IOException
-