java.lang.Object
com.ibm.dtfj.image.j9.corrupt.CorruptImagePointer
- All Implemented Interfaces:
ImagePointer
Class to represent a corrupt pointer and can be used to populate a corrupt data exception.
It will throw exceptions if an attempt is made to read data using it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(long offset) Build a new image pointer offset from this one by the given amount.longGet the unwrapped address, represented as a Java long.Get the address space to which this pointer belongs.bytegetByteAt(long index) Get the value at the given offset from this pointer.doublegetDoubleAt(long index) Get the value at the given offset from this pointer.floatgetFloatAt(long index) Get the value at the given offset from this pointer.intgetIntAt(long index) Get the value at the given offset from this pointer.longgetLongAt(long index) Get the value at the given offset from this pointer.getPointerAt(long index) Get the value at the given offset from this pointer.Get the OS-specific properties for this addressshortgetShortAt(long index) Get the value at the given offset from this pointer.booleanTests memory execute permission.booleanTests memory read/write permission.booleanisShared()Tests memory shared permission.Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface com.ibm.dtfj.image.ImagePointer
equals, hashCode
-
Constructor Details
-
CorruptImagePointer
-
-
Method Details
-
add
Description copied from interface:ImagePointerBuild a new image pointer offset from this one by the given amount.- Specified by:
addin interfaceImagePointer- Parameters:
offset- Offset in bytes.- Returns:
- a new ImagePointer based at getAddress() + offset
-
getAddress
public long getAddress()Description copied from interface:ImagePointerGet the unwrapped address, represented as a Java long.
Use caution when comparing addresses, as some addresses may be negative.
Note that, on segmented memory architectures, it may not be possible to represent all addresses accurately as integers.
- Specified by:
getAddressin interfaceImagePointer- Returns:
- the unwrapped address, represented as a 64-bit integer.
-
getAddressSpace
Description copied from interface:ImagePointerGet the address space to which this pointer belongs.- Specified by:
getAddressSpacein interfaceImagePointer- Returns:
- the address space to which this pointer belongs.
-
getByteAt
Description copied from interface:ImagePointerGet the value at the given offset from this pointer.- Specified by:
getByteAtin interfaceImagePointer- Parameters:
index- an offset (in bytes) from the current position- Returns:
- the 8-bit byte stored at getAddress() + index
- Throws:
MemoryAccessException- if the memory cannot be readCorruptDataException- if the memory should be in the image, but is missing or corrupted
-
getDoubleAt
Description copied from interface:ImagePointerGet the value at the given offset from this pointer.- Specified by:
getDoubleAtin interfaceImagePointer- Parameters:
index- an offset (in bytes) from the current position- Returns:
- the 64-bit double stored at getAddress() + index
- Throws:
MemoryAccessException- if the memory cannot be readCorruptDataException- if the memory should be in the image, but is missing or corrupted
-
getFloatAt
Description copied from interface:ImagePointerGet the value at the given offset from this pointer.- Specified by:
getFloatAtin interfaceImagePointer- Parameters:
index- an offset (in bytes) from the current position- Returns:
- the 32-bit float stored at getAddress() + index
- Throws:
MemoryAccessException- if the memory cannot be readCorruptDataException- if the memory should be in the image, but is missing or corrupted
-
getIntAt
Description copied from interface:ImagePointerGet the value at the given offset from this pointer.- Specified by:
getIntAtin interfaceImagePointer- Parameters:
index- an offset (in bytes) from the current position- Returns:
- the 32-bit int stored at getAddress() + index
- Throws:
MemoryAccessException- if the memory cannot be readCorruptDataException- if the memory should be in the image, but is missing or corrupted
-
getLongAt
Description copied from interface:ImagePointerGet the value at the given offset from this pointer.- Specified by:
getLongAtin interfaceImagePointer- Parameters:
index- an offset (in bytes) from the current position- Returns:
- the 64-bit long stored at getAddress() + index
- Throws:
MemoryAccessException- if the memory cannot be readCorruptDataException- if the memory should be in the image, but is missing or corrupted
-
getPointerAt
Description copied from interface:ImagePointerGet the value at the given offset from this pointer. To determine the number of bytes to skip after this call to read the next value, useImageProcess.getPointerSize(). Note: to create an ImagePointer using an absolute address usecom.ibm.dtfj.image.ImageAddressSpace.getPointer()- Specified by:
getPointerAtin interfaceImagePointer- Parameters:
index- an offset (in bytes) from the current position- Returns:
- the 32 or 64-bit pointer stored at getAddress() + index
- Throws:
MemoryAccessException- if the memory cannot be readCorruptDataException- if the memory should be in the image, but is missing or corrupted- See Also:
-
getShortAt
Description copied from interface:ImagePointerGet the value at the given offset from this pointer.- Specified by:
getShortAtin interfaceImagePointer- Parameters:
index- an offset (in bytes) from the current position- Returns:
- the 16-bit short stored at getAddress() + index
- Throws:
MemoryAccessException- if the memory cannot be readCorruptDataException- if the memory should be in the image, but is missing or corrupted
-
isExecutable
Description copied from interface:ImagePointerTests memory execute permission.- Specified by:
isExecutablein interfaceImagePointer- Returns:
- true if this memory address is within an executable page.
- Throws:
DataUnavailable
-
isReadOnly
Description copied from interface:ImagePointerTests memory read/write permission.- Specified by:
isReadOnlyin interfaceImagePointer- Returns:
- true if this memory address is read-only. False otherwise.
- Throws:
DataUnavailable
-
getProperties
Description copied from interface:ImagePointerGet the OS-specific properties for this address- Specified by:
getPropertiesin interfaceImagePointer- Returns:
- a table of OS-specific properties for this address.
Values which are commonly available include
- "readable" -- whether the memory address can be read from
- "writable" -- whether the memory address can be written to
- "executable" -- whether data in the memory address can be executed
-