com.ibm.dtfj.image

Interface ImagePointer


  1. public interface ImagePointer
Represents an address in memory. To create an ImagePointer using an absolute address use com.ibm.dtfj.image.ImageAddressSpace.getPointer()
See Also:
com.ibm.dtfj.image.ImageAddressSpace#getPointer()

Method Summary

Modifier and Type Method and Description
  1. ImagePointer
add(long offset)
Build a new image pointer offset from this one by the given amount.
  1. boolean
equals(java.lang.Object obj)
  1. long
getAddress()
Get the unwrapped address, represented as a Java long.
  1. ImageAddressSpace
getAddressSpace()
Get the address space to which this pointer belongs.
  1. byte
getByteAt(long index)
Get the value at the given offset from this pointer.
  1. double
getDoubleAt(long index)
Get the value at the given offset from this pointer.
  1. float
getFloatAt(long index)
Get the value at the given offset from this pointer.
  1. int
getIntAt(long index)
Get the value at the given offset from this pointer.
  1. long
getLongAt(long index)
Get the value at the given offset from this pointer.
  1. ImagePointer
getPointerAt(long index)
Get the value at the given offset from this pointer.
  1. short
getShortAt(long index)
Get the value at the given offset from this pointer.
  1. int
hashCode()
  1. boolean
isExecutable()
Tests memory execute permission.
  1. boolean
isReadOnly()
Tests memory read/write permission.
  1. boolean
isShared()
Tests memory shared permission.

Method Detail

getAddress

  1. long getAddress()

Get 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.

Returns:
the unwrapped address, represented as a 64-bit integer.

getAddressSpace

  1. ImageAddressSpace getAddressSpace( )
Get the address space to which this pointer belongs.
Returns:
the address space to which this pointer belongs.

add

  1. ImagePointer add(long offset)
Build a new image pointer offset from this one by the given amount.
Parameters:
offset - Offset in bytes.
Returns:
a new ImagePointer based at getAddress() + offset

isExecutable

  1. boolean isExecutable()
  2. throws DataUnavailable
Tests memory execute permission.
Returns:
true if this memory address is within an executable page.
Throws:

isReadOnly

  1. boolean isReadOnly()
  2. throws DataUnavailable
Tests memory read/write permission.
Returns:
true if this memory address is read-only. False otherwise.
Throws:

isShared

  1. boolean isShared()
  2. throws DataUnavailable
Tests memory shared permission.
Returns:
true if this memory address is shared between processes.
Throws:

getPointerAt

  1. ImagePointer getPointerAt(long index)
  2. throws MemoryAccessException
  3. CorruptDataException
Get 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, use ImageProcess.getPointerSize(). Note: to create an ImagePointer using an absolute address use com.ibm.dtfj.image.ImageAddressSpace.getPointer()
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 read
CorruptDataException - if the memory should be in the image, but is missing or corrupted
See Also:
ImageProcess.getPointerSize(), ImageAddressSpace#getPointer()

getLongAt

  1. long getLongAt(long index)
  2. throws MemoryAccessException
  3. CorruptDataException
Get the value at the given offset from this pointer.
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 read
CorruptDataException - if the memory should be in the image, but is missing or corrupted

getIntAt

  1. int getIntAt(long index)
  2. throws MemoryAccessException
  3. CorruptDataException
Get the value at the given offset from this pointer.
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 read
CorruptDataException - if the memory should be in the image, but is missing or corrupted

getShortAt

  1. short getShortAt(long index)
  2. throws MemoryAccessException
  3. CorruptDataException
Get the value at the given offset from this pointer.
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 read
CorruptDataException - if the memory should be in the image, but is missing or corrupted

getByteAt

  1. byte getByteAt(long index)
  2. throws MemoryAccessException
  3. CorruptDataException
Get the value at the given offset from this pointer.
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 read
CorruptDataException - if the memory should be in the image, but is missing or corrupted

getFloatAt

  1. float getFloatAt(long index)
  2. throws MemoryAccessException
  3. CorruptDataException
Get the value at the given offset from this pointer.
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 read
CorruptDataException - if the memory should be in the image, but is missing or corrupted

getDoubleAt

  1. double getDoubleAt(long index)
  2. throws MemoryAccessException
  3. CorruptDataException
Get the value at the given offset from this pointer.
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 read
CorruptDataException - if the memory should be in the image, but is missing or corrupted

equals

  1. boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Parameters:
obj -
Returns:
True obj refers to the same Image Pointer in the image

hashCode

  1. int hashCode()
Overrides:
hashCode in class java.lang.Object