Class CommonAddressSpace

java.lang.Object
com.ibm.dtfj.addressspace.CommonAddressSpace
All Implemented Interfaces:
IAbstractAddressSpace
Direct Known Subclasses:
DumpReaderAddressSpace, LayeredAddressSpace, SimpleAddressSpace

public abstract class CommonAddressSpace extends Object implements IAbstractAddressSpace
  • Constructor Details

    • CommonAddressSpace

      protected CommonAddressSpace(MemoryRange[] translations, boolean isLittleEndian, boolean is64Bit)
  • Method Details

    • getMemoryRanges

      public Iterator getMemoryRanges()
      Specified by:
      getMemoryRanges in interface IAbstractAddressSpace
      Returns:
      An iterator of the MemoryRange objects making up the address space
      See Also:
    • _residentRange

      protected MemoryRange _residentRange(int asid, long address) throws MemoryAccessException
      Throws:
      MemoryAccessException
    • findWhichMemoryRange

      protected static int findWhichMemoryRange(int asid, long addr, MemoryRange[] ranges, Integer lastRange, boolean doLinearIfNotFound)
      This searches memory ranges for an addr using a binary chop and returns an int indicating the memory range or -1 if address is not within any memory range......
      Parameters:
      asid - TODO
    • compareAddress

      protected static int compareAddress(int lasid, long lhs, int rasid, long rhs)
    • getByteOrder

      public ByteOrder getByteOrder()
      Description copied from interface: IAbstractAddressSpace
      Return the byte order of this address space.
      Specified by:
      getByteOrder in interface IAbstractAddressSpace
      Returns:
      the byte order of this address space
    • getMemoryBytes

      public byte[] getMemoryBytes(long vaddr, int size)
      Description copied from interface: IAbstractAddressSpace
      This method is provided to appease JExtract by emulating part of the old API which is used by the JExtract natives.
      Specified by:
      getMemoryBytes in interface IAbstractAddressSpace
      Parameters:
      vaddr -
      size -
      Returns:
    • getMemoryBytes

      public byte[] getMemoryBytes(int asid, long vaddr, int size)
    • findPattern

      public long findPattern(byte[] whatBytes, int alignment, long startFrom)
      Description copied from interface: IAbstractAddressSpace
      This method is provided to appease JExtract by emulating part of the old API which is used by the JExtract natives. Also used to search for the J9RAS structure in J9RASReader.java
      Specified by:
      findPattern in interface IAbstractAddressSpace
      Parameters:
      whatBytes - The pattern to search for
      alignment - The alignment boundary where the pattern can be expected to start
      startFrom - The first memory address to start searching in
      Returns:
    • getLongAt

      public long getLongAt(int asid, long address) throws MemoryAccessException
      Specified by:
      getLongAt in interface IAbstractAddressSpace
      Parameters:
      asid - an address space ID
      address - a byte-offset into the asid
      Returns:
      the 64-bit long stored at address in asid
      Throws:
      MemoryAccessException - if the memory cannot be read
    • getIntAt

      public int getIntAt(int asid, long address) throws MemoryAccessException
      Specified by:
      getIntAt in interface IAbstractAddressSpace
      Parameters:
      asid - an address space ID
      address - a byte-offset into the asid
      Returns:
      the 32-bit int stored at address in asid
      Throws:
      MemoryAccessException - if the memory cannot be read
    • getShortAt

      public short getShortAt(int asid, long address) throws MemoryAccessException
      Specified by:
      getShortAt in interface IAbstractAddressSpace
      Parameters:
      asid - an address space ID
      address - a byte-offset into the asid
      Returns:
      the 16-bit short stored at address in asid
      Throws:
      MemoryAccessException - if the memory cannot be read
    • getByteAt

      public byte getByteAt(int asid, long address) throws MemoryAccessException
      Specified by:
      getByteAt in interface IAbstractAddressSpace
      Parameters:
      asid - an address space ID
      address - a byte-offset into the asid
      Returns:
      the 8-bit byte stored at address in asid
      Throws:
      MemoryAccessException - if the memory cannot be read
    • getPointerAt

      public long getPointerAt(int asid, long address) throws MemoryAccessException
      Specified by:
      getPointerAt in interface IAbstractAddressSpace
      Parameters:
      asid - an address space ID
      address - a byte-offset into the asid
      Returns:
      the pointer stored at address in asid
      Throws:
      MemoryAccessException - if the memory cannot be read
    • bytesPerPointer

      public int bytesPerPointer(int asid)
      Description copied from interface: IAbstractAddressSpace
      Provided so that callers can determine more complicated memory geometry than what can be expressed with offsets and the above scalar data readers.
      Specified by:
      bytesPerPointer in interface IAbstractAddressSpace
      Parameters:
      asid - The address space id.
      Returns:
      The number of bytes which are required to express a native pointer in the underlying address space.