Class MemoryStub

  • All Implemented Interfaces:
    AddressSetView, Memory, java.lang.Iterable<AddressRange>

    public class MemoryStub
    extends AddressSet
    implements Memory
    MemoryStub can be extended for use by tests. It throws an UnsupportedOperationException for all methods in the Memory interface. Any method that is needed for your test can then be overridden so it can provide its own test implementation and return value.
    • Constructor Detail

      • MemoryStub

        public MemoryStub()
      • MemoryStub

        public MemoryStub​(byte[] bytes)
    • Method Detail

      • getAddressRanges

        public AddressRangeIterator getAddressRanges​(boolean forward)
        Description copied from interface: AddressSetView
        Returns an iterator over the ranges in the specified order
        Specified by:
        getAddressRanges in interface AddressSetView
        Overrides:
        getAddressRanges in class AddressSet
        Parameters:
        forward - the ranges are returned from lowest to highest, otherwise from highest to lowest
        Returns:
        an iterator over all the addresse ranges in the set.
      • getAddressRanges

        public AddressRangeIterator getAddressRanges​(Address start,
                                                     boolean forward)
        Description copied from interface: AddressSetView
        Returns an iterator of address ranges starting with the range that contains the given address. If there is no range containing the start address, then the the first range will be the next range greater than the start address if going forward, otherwise the range less than the start address
        Specified by:
        getAddressRanges in interface AddressSetView
        Overrides:
        getAddressRanges in class AddressSet
        Parameters:
        start - the address the the first range should contain.
        forward - true iterators forward, false backwards
        Returns:
        the AddressRange iterator
      • iterator

        public java.util.Iterator<AddressRange> iterator​(boolean forward)
        Description copied from interface: AddressSetView
        Returns an iterator over the ranges in the specified order
        Specified by:
        iterator in interface AddressSetView
        Overrides:
        iterator in class AddressSet
        Parameters:
        forward - the ranges are returned from lowest to highest, otherwise from highest to lowest
        Returns:
        an iterator over all the addresse ranges in the set.
      • iterator

        public java.util.Iterator<AddressRange> iterator​(Address start,
                                                         boolean forward)
        Description copied from interface: AddressSetView
        Returns an iterator of address ranges starting with the range that contains the given address. If there is no range containing the start address, then the the first range will be the next range greater than the start address if going forward, otherwise the range less than the start address
        Specified by:
        iterator in interface AddressSetView
        Overrides:
        iterator in class AddressSet
        Parameters:
        start - the address the the first range should contain.
        forward - true iterators forward, false backwards
        Returns:
        the AddressRange iterator
      • getAddresses

        public AddressIterator getAddresses​(boolean forward)
        Description copied from interface: AddressSetView
        Returns an iterator over all addresses in this set.
        Specified by:
        getAddresses in interface AddressSetView
        Overrides:
        getAddresses in class AddressSet
        Parameters:
        forward - if true the address are return in increasing order, otherwise in decreasing order.
        Returns:
        an iterator over all addresses in this set.
      • getAddresses

        public AddressIterator getAddresses​(Address start,
                                            boolean forward)
        Description copied from interface: AddressSetView
        Returns an iterator over the addresses in this address set starting at the start address
        Specified by:
        getAddresses in interface AddressSetView
        Overrides:
        getAddresses in class AddressSet
        Parameters:
        start - address to start iterating at in the address set
        forward - if true address are return from lowest to highest, else from highest to lowest
        Returns:
        an iterator over the addresses in this address set starting at the start address
      • intersects

        public boolean intersects​(AddressSetView addrSet)
        Description copied from interface: AddressSetView
        Determine if this address set intersects with the specified address set.
        Specified by:
        intersects in interface AddressSetView
        Overrides:
        intersects in class AddressSet
        Parameters:
        addrSet - address set to check intersection with.
        Returns:
        true if this set intersects the specified addrSet else false
      • intersects

        public boolean intersects​(Address start,
                                  Address end)
        Description copied from interface: AddressSetView
        Determine if the start and end range intersects with the specified address set.
        Specified by:
        intersects in interface AddressSetView
        Overrides:
        intersects in class AddressSet
        Parameters:
        start - start of range
        end - end of range
        Returns:
        true if the given range intersects this address set.
      • xor

        public AddressSet xor​(AddressSetView addrSet)
        Description copied from interface: AddressSetView
        Computes the exclusive-or of this address set with the given set. This method does not modify this address set.
        Specified by:
        xor in interface AddressSetView
        Overrides:
        xor in class AddressSet
        Parameters:
        addrSet - address set to exclusive-or with.
        Returns:
        AddressSet a new address set containing all addresses that are in either this set or the given set, but not in both sets
      • getProgram

        public Program getProgram()
        Description copied from interface: Memory
        Returns the program that this memory belongs to.
        Specified by:
        getProgram in interface Memory
      • getLoadedAndInitializedAddressSet

        public AddressSetView getLoadedAndInitializedAddressSet()
        Description copied from interface: Memory
        Returns the set of addresses which correspond to all the "loaded" memory blocks that have initialized data. This does not include initialized memory blocks that contain data from the program's file header such as debug sections.
        Specified by:
        getLoadedAndInitializedAddressSet in interface Memory
      • getAllInitializedAddressSet

        public AddressSetView getAllInitializedAddressSet()
        Description copied from interface: Memory
        Returns the set of addresses which correspond to all memory blocks that have initialized data. This includes initialized memory blocks that contain data from the program's file header that are not actually in the running in memory image, such as debug sections. Use Memory.getLoadedAndInitializedAddressSet() if you only want the addressed of the loaded in memory blocks.
        Specified by:
        getAllInitializedAddressSet in interface Memory
      • getExecuteSet

        public AddressSetView getExecuteSet()
        Description copied from interface: Memory
        Returns the set of addresses which correspond to the executable memory.
        Specified by:
        getExecuteSet in interface Memory
      • isBigEndian

        public boolean isBigEndian()
        Description copied from interface: Memory
        Returns true if the memory is bigEndian, false otherwise.
        Specified by:
        isBigEndian in interface Memory
      • setLiveMemoryHandler

        public void setLiveMemoryHandler​(LiveMemoryHandler handler)
        Description copied from interface: Memory
        Sets the live memory handler
        Specified by:
        setLiveMemoryHandler in interface Memory
        Parameters:
        handler - the live memory handler
      • getLiveMemoryHandler

        public LiveMemoryHandler getLiveMemoryHandler()
        Description copied from interface: Memory
        Returns the live memory handler instance used by this memory.
        Specified by:
        getLiveMemoryHandler in interface Memory
        Returns:
        the live memory handler
      • createInitializedBlock

        public MemoryBlock createInitializedBlock​(java.lang.String name,
                                                  Address start,
                                                  java.io.InputStream is,
                                                  long length,
                                                  TaskMonitor monitor,
                                                  boolean overlay)
        Description copied from interface: Memory
        Create an initialized memory block and add it to this Memory.
        Specified by:
        createInitializedBlock in interface Memory
        Parameters:
        name - block name (See Memory.isValidMemoryBlockName(String) for naming rules)
        start - start address of the block
        is - source of the data used to fill the block or null for zero initialization.
        length - the size of the block
        monitor - task monitor
        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
      • createInitializedBlock

        public MemoryBlock createInitializedBlock​(java.lang.String name,
                                                  Address start,
                                                  long size,
                                                  byte initialValue,
                                                  TaskMonitor monitor,
                                                  boolean overlay)
        Description copied from interface: Memory
        Create an initialized memory block and add it to this Memory.
        Specified by:
        createInitializedBlock in interface Memory
        Parameters:
        name - block name (See Memory.isValidMemoryBlockName(String) for naming rules)
        start - start of the block
        size - block length (positive non-zero value required)
        initialValue - initialization value for every byte in the block.
        monitor - progress monitor, may be null.
        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
      • createUninitializedBlock

        public MemoryBlock createUninitializedBlock​(java.lang.String name,
                                                    Address start,
                                                    long size,
                                                    boolean overlay)
        Description copied from interface: Memory
        Create an uninitialized memory block and add it to this Memory.
        Specified by:
        createUninitializedBlock in interface Memory
        Parameters:
        name - block name (See Memory.isValidMemoryBlockName(String) for naming rules)
        start - start of the block
        size - block length
        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 Uninitialized Memory Block
      • createBitMappedBlock

        public MemoryBlock createBitMappedBlock​(java.lang.String name,
                                                Address start,
                                                Address mappedAddress,
                                                long length,
                                                boolean overlay)
                                         throws LockException,
                                                MemoryConflictException,
                                                AddressOverflowException
        Description copied from interface: Memory
        Create a bit overlay memory block and add it to this Memory.
        Specified by:
        createBitMappedBlock in interface Memory
        Parameters:
        name - block name (See Memory.isValidMemoryBlockName(String) for naming rules)
        start - start of the block
        mappedAddress - start address in the source block for the beginning of this block
        length - block length
        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 Bit Memory Block
        Throws:
        LockException - if exclusive lock not in place (see haveLock())
        MemoryConflictException - if the new block overlaps with a previous block
        AddressOverflowException - if block specification exceeds bounds of address space
      • createByteMappedBlock

        public MemoryBlock createByteMappedBlock​(java.lang.String name,
                                                 Address start,
                                                 Address mappedAddress,
                                                 long length,
                                                 ByteMappingScheme byteMappingScheme,
                                                 boolean overlay)
                                          throws LockException,
                                                 MemoryConflictException,
                                                 AddressOverflowException,
                                                 java.lang.IllegalArgumentException
        Description copied from interface: Memory
        Create a memory block that uses the bytes located at a different location with a 1:1 byte mapping scheme.
        Specified by:
        createByteMappedBlock in interface Memory
        Parameters:
        name - block name (See Memory.isValidMemoryBlockName(String) for naming rules)
        start - start of the block
        mappedAddress - start address in the source block for the beginning of this block
        length - block length
        byteMappingScheme - byte mapping scheme (may be null for 1:1 mapping)
        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 Bit Memory Block
        Throws:
        LockException - if exclusive lock not in place (see haveLock())
        MemoryConflictException - if the new block overlaps with a previous block
        AddressOverflowException - if block specification exceeds bounds of address space
        java.lang.IllegalArgumentException - if invalid block name
      • removeBlock

        public void removeBlock​(MemoryBlock block,
                                TaskMonitor monitor)
                         throws LockException
        Description copied from interface: Memory
        Remove the memory block.
        Specified by:
        removeBlock in interface Memory
        Parameters:
        block - the block to be removed.
        monitor - monitor that is used to cancel the remove operation
        Throws:
        LockException - if exclusive lock not in place (see haveLock())
      • getSize

        public long getSize()
        Description copied from interface: Memory
        Get the memory size in bytes.
        Specified by:
        getSize in interface Memory
      • getBlock

        public MemoryBlock getBlock​(Address addr)
        Description copied from interface: Memory
        Returns the Block which contains addr.
        Specified by:
        getBlock in interface Memory
        Parameters:
        addr - a valid data Address.
        Returns:
        the block containing addr; null if addr is not a valid location.
      • getBlock

        public MemoryBlock getBlock​(java.lang.String blockName)
        Description copied from interface: Memory
        Returns the Block with the specified blockName
        Specified by:
        getBlock in interface Memory
        Parameters:
        blockName - the name of the requested block
        Returns:
        the Block with the specified blockName
      • getBlocks

        public MemoryBlock[] getBlocks()
        Description copied from interface: Memory
        Returns an array containing all the memory blocks.
        Specified by:
        getBlocks in interface Memory
      • findBytes

        public Address findBytes​(Address addr,
                                 byte[] bytes,
                                 byte[] masks,
                                 boolean forward,
                                 TaskMonitor monitor)
        Description copied from interface: Memory
        Finds a sequence of contiguous bytes that match the given byte array at all bit positions where the mask contains an "on" bit.
        Specified by:
        findBytes in interface Memory
        Parameters:
        addr - The beginning address in memory to search.
        bytes - the array of bytes to search for.
        masks - the array of masks. (One for each byte in the byte array) if all bits of each byte is to be checked (ie: all mask bytes are 0xff), then pass a null for masks.
        forward - if true, search in the forward direction.
        Returns:
        The address of where the first match is found. Null is returned if there is no match.
      • findBytes

        public Address findBytes​(Address startAddr,
                                 Address endAddr,
                                 byte[] bytes,
                                 byte[] masks,
                                 boolean forward,
                                 TaskMonitor monitor)
        Description copied from interface: Memory
        Finds a sequence of contiguous bytes that match the given byte array at all bit positions where the mask contains an "on" bit. Starts at startAddr and ends at endAddr. If forward is true, search starts at startAddr and will end if startAddr ">" endAddr. If forward is false, search starts at start addr and will end if startAddr "<" endAddr.
        Specified by:
        findBytes in interface Memory
        Parameters:
        startAddr - The beginning address in memory to search.
        endAddr - The ending address in memory to search (inclusive).
        bytes - the array of bytes to search for.
        masks - the array of masks. (One for each byte in the byte array) if all bits of each byte is to be checked (ie: all mask bytes are 0xff), then pass a null for masks.
        forward - if true, search in the forward direction.
        Returns:
        The address of where the first match is found. Null is returned if there is no match.
      • getBytes

        public int getBytes​(Address addr,
                            byte[] dest)
                     throws MemoryAccessException
        Description copied from interface: Memory
        Get dest.length number of bytes starting at the given address.
        Specified by:
        getBytes in interface Memory
        Parameters:
        addr - the starting Address.
        dest - the byte array to populate.
        Returns:
        the number of bytes put into dest. May be less than dest.length if the requested number extends beyond available memory.
        Throws:
        MemoryAccessException - if the starting address is not contained in any memory block.
      • getBytes

        public int getBytes​(Address addr,
                            byte[] dest,
                            int dIndex,
                            int size)
                     throws MemoryAccessException
        Description copied from interface: Memory
        Get size number of bytes starting at the given address and populates dest starting at dIndex.
        Specified by:
        getBytes in interface Memory
        Parameters:
        addr - the starting Address.
        dest - the byte array to populate.
        dIndex - the offset into dest to place the bytes.
        size - the number of bytes to get.
        Returns:
        the number of bytes put into dest. May be less than size if the requested number extends beyond initialized / available memory.
        Throws:
        MemoryAccessException - if the starting address is not contained in any memory block or is an uninitialized location.
      • getShort

        public short getShort​(Address addr)
                       throws MemoryAccessException
        Description copied from interface: Memory
        Get the short at addr.
        Specified by:
        getShort in interface Memory
        Parameters:
        addr - the Address where the short starts.
        Returns:
        the short.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • getShort

        public short getShort​(Address addr,
                              boolean bigEndian)
                       throws MemoryAccessException
        Description copied from interface: Memory
        Get the short at addr using the specified endian order.
        Specified by:
        getShort in interface Memory
        Parameters:
        addr - the Address where the short starts.
        bigEndian - true means to get the short in bigEndian order
        Returns:
        the short.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • getShorts

        public int getShorts​(Address addr,
                             short[] dest)
                      throws MemoryAccessException
        Description copied from interface: Memory
        Get dest.length number of shorts starting at the given address.
        Specified by:
        getShorts in interface Memory
        Parameters:
        addr - the starting Address.
        dest - the short array to populate.
        Returns:
        the number of shorts put into dest. May be less than dest.length if the requested number extends beyond available memory. If the number of retrievable bytes is odd, the final byte will be discarded.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • getShorts

        public int getShorts​(Address addr,
                             short[] dest,
                             int dIndex,
                             int nElem)
                      throws MemoryAccessException
        Description copied from interface: Memory
        Get dest.length number of shorts starting at the given address.
        Specified by:
        getShorts in interface Memory
        Parameters:
        addr - the starting Address.
        dest - the short array to populate.
        dIndex - the offset into dest to place the shorts.
        nElem - the number of shorts to get.
        Returns:
        the number of shorts put into dest. May be less than dest.length if the requested number extends beyond available memory. If the number of retrievable bytes is odd, the final byte will be discarded.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • getShorts

        public int getShorts​(Address addr,
                             short[] dest,
                             int dIndex,
                             int nElem,
                             boolean isBigEndian)
                      throws MemoryAccessException
        Description copied from interface: Memory
        Get dest.length number of shorts starting at the given address.
        Specified by:
        getShorts in interface Memory
        Parameters:
        addr - the starting Address.
        dest - the short array to populate.
        dIndex - the offset into dest to place the shorts.
        nElem - the number of shorts to get.
        isBigEndian - true means to get the shorts in bigEndian order
        Returns:
        the number of shorts put into dest. May be less than dest.length if the requested number extends beyond available memory. If the number of retrievable bytes is odd, the final byte will be discarded.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • getInt

        public int getInt​(Address addr)
                   throws MemoryAccessException
        Description copied from interface: Memory
        Get the int at addr.
        Specified by:
        getInt in interface Memory
        Parameters:
        addr - the Address where the int starts.
        Returns:
        the int.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • getInt

        public int getInt​(Address addr,
                          boolean bigEndian)
                   throws MemoryAccessException
        Description copied from interface: Memory
        Get the int at addr using the specified endian order.
        Specified by:
        getInt in interface Memory
        Parameters:
        addr - the Address where the int starts.
        bigEndian - true means to get the int in big endian order
        Returns:
        the int.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • getInts

        public int getInts​(Address addr,
                           int[] dest)
                    throws MemoryAccessException
        Description copied from interface: Memory
        Get dest.length number of ints starting at the given address.
        Specified by:
        getInts in interface Memory
        Parameters:
        addr - the starting Address.
        dest - the int array to populate.
        Returns:
        the number of ints put into dest. May be less than dest.length if the requested number extends beyond available memory. If the number of retrievable bytes is not 0 mod 4, the final byte(s) will be discarded.
        Throws:
        MemoryAccessException - if the starting address is not contained in any memory block.
      • getInts

        public int getInts​(Address addr,
                           int[] dest,
                           int dIndex,
                           int nElem)
                    throws MemoryAccessException
        Description copied from interface: Memory
        Get dest.length number of ints starting at the given address.
        Specified by:
        getInts in interface Memory
        Parameters:
        addr - the starting Address.
        dest - the int array to populate.
        dIndex - the offset into dest to place the ints.
        nElem - the number of ints to get.
        Returns:
        the number of ints put into dest. May be less than dest.length if the requested number extends beyond available memory. If the number of retrievable bytes is not 0 mod 4, the final byte(s) will be discarded.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • getInts

        public int getInts​(Address addr,
                           int[] dest,
                           int dIndex,
                           int nElem,
                           boolean isBigEndian)
                    throws MemoryAccessException
        Description copied from interface: Memory
        Get dest.length number of ints starting at the given address.
        Specified by:
        getInts in interface Memory
        Parameters:
        addr - the starting Address.
        dest - the int array to populate.
        dIndex - the offset into dest to place the ints.
        nElem - the number of ints to get.
        isBigEndian - true means to get the ints in bigEndian order
        Returns:
        the number of ints put into dest. May be less than dest.length if the requested number extends beyond available memory. If the number of retrievable bytes is not 0 mod 4, the final byte(s) will be discarded.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • getLong

        public long getLong​(Address addr)
                     throws MemoryAccessException
        Description copied from interface: Memory
        Get the long at addr.
        Specified by:
        getLong in interface Memory
        Parameters:
        addr - the Address where the long starts.
        Returns:
        the long.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • getLong

        public long getLong​(Address addr,
                            boolean bigEndian)
                     throws MemoryAccessException
        Description copied from interface: Memory
        Get the long at addr in the specified endian order.
        Specified by:
        getLong in interface Memory
        Parameters:
        addr - the Address where the long starts.
        bigEndian - true means to get the long in big endian order
        Returns:
        the long.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • getLongs

        public int getLongs​(Address addr,
                            long[] dest)
                     throws MemoryAccessException
        Description copied from interface: Memory
        Get dest.length number of longs starting at the given address.
        Specified by:
        getLongs in interface Memory
        Parameters:
        addr - the starting Address.
        dest - the long array to populate.
        Returns:
        the number of longs put into dest. May be less than dest.length if the requested number extends beyond available memory. If the number of retrievable bytes is not 0 mod 8, the final byte(s) will be discarded.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • getLongs

        public int getLongs​(Address addr,
                            long[] dest,
                            int dIndex,
                            int nElem)
                     throws MemoryAccessException
        Description copied from interface: Memory
        Get dest.length number of longs starting at the given address.
        Specified by:
        getLongs in interface Memory
        Parameters:
        addr - the starting Address.
        dest - the long array to populate.
        dIndex - the offset into dest to place the longs.
        nElem - the number of longs to get.
        Returns:
        the number of longs put into dest. May be less than dest.length if the requested number extends beyond available memory. If the number of retrievable bytes is not 0 mod 8, the final byte(s) will be discarded.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • getLongs

        public int getLongs​(Address addr,
                            long[] dest,
                            int dIndex,
                            int nElem,
                            boolean isBigEndian)
                     throws MemoryAccessException
        Description copied from interface: Memory
        Get dest.length number of longs starting at the given address.
        Specified by:
        getLongs in interface Memory
        Parameters:
        addr - the starting Address.
        dest - the long array to populate.
        dIndex - the offset into dest to place the longs.
        nElem - the number of longs to get.
        isBigEndian - true means to get the longs in bigEndian order
        Returns:
        the number of longs put into dest. May be less than dest.length if the requested number extends beyond available memory. If the number of retrievable bytes is not 0 mod 8, the final byte(s) will be discarded.
        Throws:
        MemoryAccessException - if not all needed bytes are contained in initialized memory.
      • setBytes

        public void setBytes​(Address addr,
                             byte[] source)
                      throws MemoryAccessException
        Description copied from interface: Memory
        Write size bytes from values at addr.
        Specified by:
        setBytes in interface Memory
        Parameters:
        addr - the starting Address.
        source - the bytes to write.
        Throws:
        MemoryAccessException - if writing is not allowed.
      • setBytes

        public void setBytes​(Address addr,
                             byte[] source,
                             int sIndex,
                             int size)
                      throws MemoryAccessException
        Description copied from interface: Memory
        Write an array of bytes. This should copy size bytes or fail!
        Specified by:
        setBytes in interface Memory
        Parameters:
        addr - the starting Address of the bytes.
        source - an array to get bytes from.
        sIndex - the starting source index.
        size - the number of bytes to fill.
        Throws:
        MemoryAccessException - if writing is not allowed.
      • setShort

        public void setShort​(Address addr,
                             short value)
                      throws MemoryAccessException
        Description copied from interface: Memory
        Write short at addr in big endian order.
        Specified by:
        setShort in interface Memory
        Parameters:
        addr - the Address of the short.
        value - the data to write.
        Throws:
        MemoryAccessException - if writing is not allowed.
      • setShort

        public void setShort​(Address addr,
                             short value,
                             boolean bigEndian)
                      throws MemoryAccessException
        Description copied from interface: Memory
        Write short at addr in the specified endian order.
        Specified by:
        setShort in interface Memory
        Parameters:
        addr - the Address of the short.
        value - the data to write.
        bigEndian - true means to write short in big endian order
        Throws:
        MemoryAccessException - if writing is not allowed.
      • setInt

        public void setInt​(Address addr,
                           int value,
                           boolean bigEndian)
                    throws MemoryAccessException
        Description copied from interface: Memory
        Write int at addr in the specified endian order.
        Specified by:
        setInt in interface Memory
        Parameters:
        addr - the Address of the int.
        value - the data to write.
        bigEndian - true means to write the short in bigEndian order
        Throws:
        MemoryAccessException - if writing is not allowed.
      • setLong

        public void setLong​(Address addr,
                            long value,
                            boolean bigEndian)
                     throws MemoryAccessException
        Description copied from interface: Memory
        Write long at addr in the specified endian order.
        Specified by:
        setLong in interface Memory
        Parameters:
        addr - the Address of the long.
        value - the data to write.
        bigEndian - true means to write the long in bigEndian order
        Throws:
        MemoryAccessException - if writing is not allowed.
      • createFileBytes

        public FileBytes createFileBytes​(java.lang.String filename,
                                         long offset,
                                         long size,
                                         java.io.InputStream is,
                                         TaskMonitor monitor)
                                  throws java.io.IOException
        Description copied from interface: Memory
        Stores a sequence of bytes into the program. Typically, this method is used by importers to store the original raw program bytes.
        Specified by:
        createFileBytes in interface Memory
        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.
        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.
      • getAllFileBytes

        public java.util.List<FileBytes> getAllFileBytes()
        Description copied from interface: Memory
        Returns a list of all the stored original file bytes objects
        Specified by:
        getAllFileBytes in interface Memory
        Returns:
        a list of all the stored original file bytes objects
      • deleteFileBytes

        public boolean deleteFileBytes​(FileBytes descriptor)
        Description copied from interface: Memory
        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.
        Specified by:
        deleteFileBytes in interface Memory
        Parameters:
        descriptor - 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.
      • createInitializedBlock

        public MemoryBlock createInitializedBlock​(java.lang.String name,
                                                  Address start,
                                                  FileBytes fileBytes,
                                                  long offset,
                                                  long size,
                                                  boolean overlay)
        Description copied from interface: Memory
        Create an initialized memory block using bytes from a FileBytes object.
        Specified by:
        createInitializedBlock in interface Memory
        Parameters:
        name - block name (See Memory.isValidMemoryBlockName(String) for naming rules)
        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
      • getAddressSourceInfo

        public AddressSourceInfo getAddressSourceInfo​(Address address)
        Description copied from interface: Memory
        Returns information (AddressSourceInfo) about the byte source at the given address.
        Specified by:
        getAddressSourceInfo in interface Memory
        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.