Interface Memory

Method Detail

  • createInitializedBlock NEW

    MemoryBlock createInitializedBlock​(java.lang.String name,
                                       Address start,
                                       FileBytes fileBytes,
                                       long offset,
                                       long size,
                                       boolean overlay)
                                throws LockException,
                                       DuplicateNameException,
                                       MemoryConflictException,
                                       AddressOverflowException
    Create an initialized memory block using bytes from a FileBytes object.
    Parameters:
    name - block name
    start - starting address of the block
    fileBytes - the FileBytes object to use as the underlying source of bytes.
    offset - the offset into the FileBytes for the first byte of this memory block.
    size - block length (positive non-zero value required)
    overlay - if true, the block will be created as an OVERLAY which means that a new overlay address space will be created and the block will have a starting address at the same offset as the given start address parameter, but in the new address space.
    Returns:
    new Initialized Memory Block
    Throws:
    LockException - if exclusive lock not in place (see haveLock())
    DuplicateNameException - if overlay is true and there is already an overlay address space with the same name as this memory block
    MemoryConflictException - if the new block overlaps with a previous block
    AddressOverflowException - if the start is beyond the address space
    java.lang.IndexOutOfBoundsException - if file bytes range specified by offset and size is out of bounds for the specified fileBytes.
  • createFileBytes NEW

    FileBytes createFileBytes​(java.lang.String filename,
                              long offset,
                              long size,
                              java.io.InputStream is,
                              TaskMonitor monitor)
                       throws java.io.IOException,
                              CancelledException
    Stores a sequence of bytes into the program. Typically, this method is used by importers to store the original raw program bytes.
    Parameters:
    filename - the name of the file from where the bytes originated
    offset - the offset into the file for the first byte in the input stream.
    size - the number of bytes to store from the input stream.
    is - the input stream that will supply the bytes to store in the program.
    monitor -
    Returns:
    a FileBytes that was created to access the bytes.
    Throws:
    java.io.IOException - if there was an IOException saving the bytes to the program database.
    CancelledException - if the user cancelled this operation. Note: the database will be stable, but the buffers may contain 0s instead of the actual bytes.
  • getAllFileBytes NEW

    java.util.List<FileBytes> getAllFileBytes()
    Returns a list of all the stored original file bytes objects
    Returns:
    a list of all the stored original file bytes objects
  • deleteFileBytes NEW

    boolean deleteFileBytes​(FileBytes fileBytes)
                     throws java.io.IOException
    Deletes a stored sequence of file bytes. The file bytes can only be deleted if there are no memory block references to the file bytes.
    Parameters:
    fileBytes - the FileBytes for the file bytes to be deleted.
    Returns:
    true if the FileBytes was deleted. If any memory blocks are referenced by this FileBytes or it is invalid then it will not be deleted and false will be returned.
    Throws:
    java.io.IOException - if there was an error updating the database.
  • getAddressSourceInfo NEW

    AddressSourceInfo getAddressSourceInfo​(Address address)
    Returns information (AddressSourceInfo) about the byte source at the given address.
    Parameters:
    address - the address to query. Returns null if the address is not in memory.
    Returns:
    information (AddressSourceInfo) about the byte source at the given address or null if the address is not in memory.