Module openj9.dtfj

Interface Emulator.ImageSpace

All Known Implementing Classes:
MutableAddressSpace
Enclosing interface:
Emulator

public static interface Emulator.ImageSpace
This interface represents a mutable address space. It is used by the Emulator to read and write values. It is similar to ImageOutputStreamImpl except that it adds the ability to allocate an area of memory.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Return true if this dump is from a 64-bit machine
    long
    malloc(int size)
    Allocate a chunk of unused memory.
    int
    readInt(long address)
    Read an int at the specified address.
    long
    readLong(long address)
    Read a long at the specified address.
    short
    readShort(long address)
    Read a short at the specified address.
    int
    readUnsignedByte(long address)
    Read a byte at the specified address.
    long
    readUnsignedInt(long address)
    Read an unsigned int at the specified address.
    int
    readUnsignedShort(long address)
    Read an unsigned short at the specified address.
    void
    writeByte(long address, int value)
    Write a byte at 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.
  • Method Details

    • readUnsignedByte

      int readUnsignedByte(long address) throws IOException
      Read a byte at the specified address.
      Throws:
      IOException - if the given address is not present in this address space
    • readUnsignedShort

      int readUnsignedShort(long address) throws IOException
      Read an unsigned short at the specified address.
      Throws:
      IOException - if the given address is not present in this address space
    • readShort

      short readShort(long address) throws IOException
      Read a short at the specified address.
      Throws:
      IOException - if the given address is not present in this address space
    • readInt

      int readInt(long address) throws IOException
      Read an int at the specified address.
      Throws:
      IOException - if the given address is not present in this address space
    • readUnsignedInt

      long readUnsignedInt(long address) throws IOException
      Read an unsigned int at the specified address.
      Throws:
      IOException - if the given address is not present in this address space
    • readLong

      long readLong(long address) throws IOException
      Read a long at the specified address.
      Throws:
      IOException - if the given address is not present in this address space
    • writeByte

      void writeByte(long address, int value) throws IOException
      Write a byte at the specified address.
      Throws:
      IOException - if the given address is not present in this address space
    • writeShort

      void writeShort(long address, int value) throws IOException
      Write a short at the specified address.
      Throws:
      IOException - if the given address is not present in this address space
    • writeInt

      void writeInt(long address, int value) throws IOException
      Write an int at the specified address.
      Throws:
      IOException - if the given address is not present in this address space
    • writeLong

      void writeLong(long address, long value) throws IOException
      Write a long at the specified address.
      Throws:
      IOException - if the given address is not present in this address space
    • malloc

      long malloc(int size) throws IOException
      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.
      Returns:
      the address of the allocated memory
      Throws:
      IOException
    • is64bit

      boolean is64bit()
      Return true if this dump is from a 64-bit machine