- java.lang.Object
-
- com.ibm.j9ddr.vm29.j9.DataType
-
- com.ibm.j9ddr.vm29.pointer.AbstractPointer
-
- Direct Known Subclasses:
CorruptPointer
,Pointer
,StructurePointer
public abstract class AbstractPointer extends DataType
-
-
Field Summary
Fields Modifier and Type Field Description protected long
address
-
Fields declared in class com.ibm.j9ddr.vm29.j9.DataType
BITFIELD_FORMAT, pointerPackageName, process, SIZEOF_BOOL, structurePackageName
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPointer(long address)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract AbstractPointer
add(long count)
abstract AbstractPointer
add(Scalar count)
abstract AbstractPointer
addOffset(long offset)
abstract AbstractPointer
addOffset(Scalar offset)
boolean
allBitsIn(long bitmask)
boolean
anyBitsIn(long bitmask)
abstract DataType
at(long index)
abstract DataType
at(Scalar index)
int
compare(AbstractPointer pointer)
boolean
eq(Object obj)
String
formatFullInteractive()
long
getAddress()
protected static IProcess
getAddressSpace()
protected char
getBaseCharAtOffset(long offset)
protected boolean
getBoolAtOffset(long offset)
protected byte
getByteAtOffset(long offset)
int
getBytesAtOffset(long offset, byte[] data)
protected double
getDoubleAtOffset(long offset)
protected float
getFloatAtOffset(long offset)
String
getHexAddress()
String
getHexValue()
This method reads number of the bytes depending on the pointers' base size.protected IDATA
getIDATAAtOffset(long offset)
protected int
getIntAtOffset(long offset)
protected long
getLongAtOffset(long offset)
protected com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer
getObjectClassAtOffset(long offset)
protected com.ibm.j9ddr.vm29.pointer.generated.J9ObjectMonitorPointer
getObjectMonitorAtOffset(long offset)
protected com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer
getObjectReferenceAtOffset(long offset)
protected long
getPointerAtOffset(long offset)
protected short
getShortAtOffset(long offset)
String
getTargetName()
protected UDATA
getUDATAAtOffset(long offset)
boolean
gt(AbstractPointer pointer)
boolean
gte(AbstractPointer pointer)
String
hexAt(long index)
This method returns the memory values at the given index.String
hexAt(Scalar index)
This method returns the memory values at the given index.boolean
isNull()
boolean
lt(AbstractPointer pointer)
boolean
lte(AbstractPointer pointer)
long
nonNullAddress()
boolean
notNull()
static void
reportClassCacheStats()
protected abstract long
sizeOfBaseType()
abstract AbstractPointer
sub(long count)
IDATA
sub(AbstractPointer pointer)
abstract AbstractPointer
sub(Scalar count)
abstract AbstractPointer
subOffset(long offset)
abstract AbstractPointer
subOffset(Scalar offset)
abstract AbstractPointer
untag()
abstract AbstractPointer
untag(long tagBits)
-
Methods declared in class com.ibm.j9ddr.vm29.j9.DataType
formatShortInteractive, getJ9RASPointer, getPointerPackageName, getProcess, getStructure, getStructure, getStructure, getStructurePackageName, init, longValue, setJ9RASPointer
-
-
-
-
Method Detail
-
add
public abstract AbstractPointer add(long count)
-
add
public abstract AbstractPointer add(Scalar count)
-
addOffset
public abstract AbstractPointer addOffset(long offset)
-
addOffset
public abstract AbstractPointer addOffset(Scalar offset)
-
sub
public abstract AbstractPointer sub(long count)
-
sub
public abstract AbstractPointer sub(Scalar count)
-
subOffset
public abstract AbstractPointer subOffset(long offset)
-
subOffset
public abstract AbstractPointer subOffset(Scalar offset)
-
untag
public abstract AbstractPointer untag(long tagBits)
-
untag
public abstract AbstractPointer untag()
-
allBitsIn
public final boolean allBitsIn(long bitmask)
-
anyBitsIn
public boolean anyBitsIn(long bitmask)
-
at
public abstract DataType at(long index) throws CorruptDataException
- Throws:
CorruptDataException
-
at
public abstract DataType at(Scalar index) throws CorruptDataException
- Throws:
CorruptDataException
-
isNull
public boolean isNull()
-
notNull
public boolean notNull()
-
eq
public boolean eq(Object obj)
-
getAddress
public long getAddress()
-
nonNullAddress
public final long nonNullAddress() throws NullPointerDereference
- Throws:
NullPointerDereference
-
getHexAddress
public String getHexAddress()
-
hexAt
public String hexAt(long index) throws CorruptDataException
This method returns the memory values at the given index. For StructurePointer instance objects, UDATA.sizeof amount of bytes are read. Otherwise, amount of bytes to be read depend on the object type. For instance, if it is I16Pointer, then 2 bytes are read. Note that this method returns bytes as they appear in the memory. It ignores endian-ization. For instance I16 value 0xABCD lays in the memory as CDAB on Little Endian platforms. And this method returns for this I16Pointer 0xCDAB and does not reverse the bytes.- Parameters:
index
- Offset of the memory to be read.- Returns:
- String representation of the value at the given index.
- Throws:
CorruptDataException
-
hexAt
public String hexAt(Scalar index) throws CorruptDataException
This method returns the memory values at the given index. For StructurePointer instance objects, UDATA.sizeof amount of bytes are read. Otherwise, amount of bytes to be read depend on the object type. For instance, if it is I16Pointer, then 2 bytes are read. Note that this method returns bytes as they appear in the memory. It ignores endian-ization. For instance I16 value 0xABCD lays in the memory as CDAB on Little Endian platforms. And this method returns for this I16Pointer 0xCDAB and does not reverse the bytes.- Parameters:
index
- Offset of the memory to be read.- Returns:
- String representation of the value at the given index.
- Throws:
CorruptDataException
-
getHexValue
public String getHexValue() throws CorruptDataException
This method reads number of the bytes depending on the pointers' base size. And if the platform is little endian, it reverses the bytes read and returns it as hex string. If the platform is big endian, then it returns the read bytes as it is as an hex string.- Returns:
- hex string of the value of this pointer points.
- Throws:
CorruptDataException
-
getAddressSpace
protected static IProcess getAddressSpace()
-
lt
public boolean lt(AbstractPointer pointer)
-
lte
public boolean lte(AbstractPointer pointer)
-
gt
public boolean gt(AbstractPointer pointer)
-
gte
public boolean gte(AbstractPointer pointer)
-
sub
public IDATA sub(AbstractPointer pointer)
-
sizeOfBaseType
protected abstract long sizeOfBaseType()
-
compare
public int compare(AbstractPointer pointer)
-
getPointerAtOffset
protected long getPointerAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
getIntAtOffset
protected int getIntAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
getDoubleAtOffset
protected double getDoubleAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
getFloatAtOffset
protected float getFloatAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
getBoolAtOffset
protected boolean getBoolAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
getUDATAAtOffset
protected UDATA getUDATAAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
getIDATAAtOffset
protected IDATA getIDATAAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
getShortAtOffset
protected short getShortAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
getByteAtOffset
protected byte getByteAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
getBytesAtOffset
public int getBytesAtOffset(long offset, byte[] data) throws CorruptDataException
- Throws:
CorruptDataException
-
getBaseCharAtOffset
protected char getBaseCharAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
getLongAtOffset
protected long getLongAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
getObjectReferenceAtOffset
protected com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer getObjectReferenceAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
getObjectClassAtOffset
protected com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer getObjectClassAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
getObjectMonitorAtOffset
protected com.ibm.j9ddr.vm29.pointer.generated.J9ObjectMonitorPointer getObjectMonitorAtOffset(long offset) throws CorruptDataException
- Throws:
CorruptDataException
-
formatFullInteractive
public String formatFullInteractive()
- Returns:
- Full DDR-interactive formatting
-
getTargetName
public String getTargetName()
-
reportClassCacheStats
public static void reportClassCacheStats()
-
-