Package ghidra.trace.database.program

# Class AbstractDBTraceProgramViewMemory

java.lang.Object
ghidra.trace.database.program.AbstractDBTraceProgramViewMemory

All Implemented Interfaces:
  `AddressSetView`, `Memory`, `TraceProgramViewMemory`, `MemoryAdapter`, `Iterable<AddressRange>`

Direct Known Subclasses:
  `DBTraceProgramViewMemory`

public abstract class AbstractDBTraceProgramViewMemory extends Object implements TraceProgramViewMemory, MemoryAdapter

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final ByteCache`
  `cache`
  `protected final DBTraceMemoryManager`
  `memoryManager`
  `protected final DBTraceProgramView`
  `program`

  ### Fields inherited from interface ghidra.program.model.mem.Memory

  `GBYTE, GBYTE_SHIFT_FACTOR, MAX_BINARY_SIZE, MAX_BINARY_SIZE_GB, MAX_BLOCK_SIZE, MAX_BLOCK_SIZE_GB`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractDBTraceProgramViewMemory(DBTraceProgramView program)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected abstract AddressSetView`
  `computeAddressSet()`
  `boolean`
  `contains(Address addr)`
  Test if the address is contained within this set.
  `boolean`
  `contains(Address start, Address end)`
  Test if the given address range is contained in this set.
  `boolean`
  `contains(AddressSetView set)`
  Test if the given address set is a subset of this set.
  `MemoryBlock`
  `convertToInitialized(MemoryBlock uninitializedBlock, byte initialValue)`
  Convert an existing uninitialized block with an initialized block.
  `MemoryBlock`
  `convertToUninitialized(MemoryBlock itializedBlock)`
  Convert an existing initialized block with an uninitialized block.
  `MemoryBlock`
  `createBitMappedBlock(String name, Address start, Address mappedAddress, long length, boolean overlay)`
  Create a bit-mapped overlay memory block and add it to this Memory.
  `MemoryBlock`
  `createBlock(MemoryBlock block, String name, Address start, long length)`
  Creates a MemoryBlock at the given address with the same properties as block, and adds it to this Memory.
  `MemoryBlock`
  `createByteMappedBlock(String name, Address start, Address mappedAddress, long length, ByteMappingScheme byteMappingScheme, boolean overlay)`
  Create a byte-mapped memory block and add it to this memory.
  `FileBytes`
  `createFileBytes(String filename, long offset, long size, InputStream is, TaskMonitor monitor)`
  Stores a sequence of bytes into the program.
  `MemoryBlock`
  `createInitializedBlock(String name, Address start, long size, byte initialValue, TaskMonitor monitor, boolean overlay)`
  Create an initialized memory block initialized and add it to this Memory.
  `MemoryBlock`
  `createInitializedBlock(String name, Address start, FileBytes fileBytes, long offset, long size, boolean overlay)`
  Create an initialized memory block using bytes from a `FileBytes` object.
  `MemoryBlock`
  `createInitializedBlock(String name, Address start, InputStream is, long length, TaskMonitor monitor, boolean overlay)`
  Create an initialized memory block based upon a data `InputStream` and add it to this Memory.
  `MemoryBlock`
  `createUninitializedBlock(String name, Address start, long size, boolean overlay)`
  Create an uninitialized memory block and add it to this Memory.
  `boolean`
  `deleteFileBytes(FileBytes fileBytes)`
  Deletes a stored sequence of file bytes.
  `Address`
  `findBytes(Address addr, byte[] bytes, byte[] masks, boolean forward, TaskMonitor monitor)`
  Finds a sequence of contiguous bytes that match the given byte array at all bit positions where the mask contains an "on" bit.
  `Address`
  `findBytes(Address startAddr, Address endAddr, byte[] bytes, byte[] masks, boolean forward, TaskMonitor monitor)`
  Finds a sequence of contiguous bytes that match the given byte array at all bit positions where the mask contains an "on" bit.
  `Address`
  `findFirstAddressInCommon(AddressSetView set)`
  Finds the first address in this collection that is also in the given addressSet.
  `AddressIterator`
  `getAddresses(boolean forward)`
  Returns an iterator over all addresses in this set.
  `AddressIterator`
  `getAddresses(Address start, boolean forward)`
  Returns an iterator over the addresses in this address set starting at the start address
  `AddressRangeIterator`
  `getAddressRanges()`
  `AddressRangeIterator`
  `getAddressRanges(boolean forward)`
  Returns an iterator over the ranges in the specified order
  `AddressRangeIterator`
  `getAddressRanges(Address start, boolean forward)`
  Returns an iterator of address ranges starting with the range that contains the given address.
  `AddressSourceInfo`
  `getAddressSourceInfo(Address address)`
  Returns information (`AddressSourceInfo`) about the byte source at the given address.
  `List<FileBytes>`
  `getAllFileBytes()`
  Returns a list of all the stored original file bytes objects
  `AddressSetView`
  `getAllInitializedAddressSet()`
  Returns the set of addresses which correspond to all memory blocks that have initialized data..
  `byte`
  `getByte(Address addr)`
  Get byte at addr.
  `int`
  `getBytes(Address addr, byte[] b, int off, int len)`
  Get size number of bytes starting at the given address and populates dest starting at dIndex.
  `AddressRange`
  `getFirstRange()`
  Returns the first range in this set or null if the set is empty
  `AddressSetView`
  `getInitializedAddressSet()`
  Returns the set of addresses which correspond to all the "loaded" memory blocks that have initialized data..
  `AddressRange`
  `getLastRange()`
  Returns the last range in this set or null if the set is empty
  `AddressSetView`
  `getLoadedAndInitializedAddressSet()`
  Returns the set of addresses which correspond to all the "loaded" memory blocks that have initialized data..
  `Address`
  `getMaxAddress()`
  Get the maximum address for this address set.
  `Address`
  `getMinAddress()`
  Get the minimum address for this address set.
  `long`
  `getNumAddresses()`
  `int`
  `getNumAddressRanges()`
  `protected AddressSetView`
  `getOrComputeAddressSet()`
  `TraceProgramView`
  `getProgram()`
  Returns the program that this memory belongs to.
  `AddressRange`
  `getRangeContaining(Address address)`
  Returns the range that contains the given address
  `long`
  `getSize()`
  Returns the memory size in bytes.
  `long`
  `getSnap()`
  `Trace`
  `getTrace()`
  `boolean`
  `hasSameAddresses(AddressSetView view)`
  Returns true if the given address set contains the same set of addresses as this set.
  `AddressSet`
  `intersect(AddressSetView view)`
  Computes the intersection of this address set with the given address set.
  `AddressSet`
  `intersectRange(Address start, Address end)`
  Computes the intersection of this address set with the given address range.
  `boolean`
  `intersects(Address start, Address end)`
  Determine if the start and end range intersects with the specified address set.
  `boolean`
  `intersects(AddressSetView addrSet)`
  Determine if this address set intersects with the specified address set.
  `protected void`
  `invalidateAddressSet()`
  `boolean`
  `isBigEndian()`
  Returns true if the memory is bigEndian, false otherwise.
  `boolean`
  `isEmpty()`
  `boolean`
  `isForceFullView()`
  `Iterator<AddressRange>`
  `iterator()`
  Returns an iterator over the address ranges in this address set.
  `Iterator<AddressRange>`
  `iterator(boolean forward)`
  Returns an iterator over the ranges in the specified order
  `Iterator<AddressRange>`
  `iterator(Address start, boolean forward)`
  Returns an iterator of address ranges starting with the range that contains the given address.
  `MemoryBlock`
  `join(MemoryBlock blockOne, MemoryBlock blockTwo)`
  Join the two blocks to create a single memory block.
  `void`
  `moveBlock(MemoryBlock block, Address newStartAddr, TaskMonitor monitor)`
  Move the memory block containing source address to the destination address.
  `void`
  `removeBlock(MemoryBlock block, TaskMonitor monitor)`
  Remove the memory block.
  `void`
  `setByte(Address addr, byte value)`
  Write byte at addr.
  `void`
  `setBytes(Address addr, byte[] source, int sIndex, int size)`
  Write an array of bytes.
  `void`
  `setForceFullView(boolean forceFullView)`
  `void`
  `split(MemoryBlock block, Address addr)`
  Split a block at the given addr and create a new block starting at addr.
  `AddressSet`
  `subtract(AddressSetView addrSet)`
  Computes the difference of this address set with the given address set (this - set).
  `AddressSet`
  `union(AddressSetView addrSet)`
  Computes the union of this address set with the given address set.
  `AddressSet`
  `xor(AddressSetView addrSet)`
  Computes the exclusive-or of this address set with the given set.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.program.model.address.AddressSetView

  `getAddressCountBefore, spliterator, spliterator, spliterator, stream, stream, stream`

  ### Methods inherited from interface java.lang.Iterable

  `forEach`

  ### Methods inherited from interface ghidra.program.model.mem.Memory

  `createByteMappedBlock, getBlock, getBlock, getBlocks, getExecuteSet, isExternalBlockAddress, locateAddressesForFileBytesOffset, locateAddressesForFileOffset`

  ### Methods inherited from interface ghidra.trace.util.MemoryAdapter

  `getBytes, getInt, getInt, getInts, getInts, getInts, getLong, getLong, getLongs, getLongs, getLongs, getShort, getShort, getShorts, getShorts, getShorts, mustRead, setBytes, setInt, setInt, setLong, setLong, setShort, setShort`

- ## Field Details

  - ### program

    protected final DBTraceProgramView program

  - ### memoryManager

    protected final DBTraceMemoryManager memoryManager

  - ### cache

    protected final ByteCache cache

- ## Constructor Details

  - ### AbstractDBTraceProgramViewMemory

    public AbstractDBTraceProgramViewMemory(DBTraceProgramView program)

- ## Method Details

  - ### computeAddressSet

    protected abstract AddressSetView computeAddressSet()

  - ### invalidateAddressSet

    protected void invalidateAddressSet()

  - ### getOrComputeAddressSet

    protected AddressSetView getOrComputeAddressSet()

  - ### setForceFullView

    public void setForceFullView(boolean forceFullView)
    Specified by:
      `setForceFullView` in interface `TraceProgramViewMemory`

  - ### isForceFullView

    public boolean isForceFullView()
    Specified by:
      `isForceFullView` in interface `TraceProgramViewMemory`

  - ### getProgram

    public TraceProgramView getProgram()
    Description copied from interface: `Memory`
    Returns the program that this memory belongs to.
    Specified by:
      `getProgram` in interface `Memory`
    Specified by:
      `getProgram` in interface `TraceProgramViewMemory`
    Returns:
      the program that this memory belongs to

  - ### getTrace

    public Trace getTrace()

  - ### getSnap

    public long getSnap()

  - ### 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`
    Returns:
      the set of addresses which correspond to all the "loaded" memory blocks that have initialized data.

  - ### 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`
    Returns:
      the set of addresses which correspond to all memory blocks that have initialized data.

  - ### getInitializedAddressSet

    public AddressSetView getInitializedAddressSet()
    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:
      `getInitializedAddressSet` in interface `Memory`
    Returns:
      the set of addresses which correspond to all the "loaded" memory blocks that have initialized data.

  - ### isBigEndian

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

  - ### createInitializedBlock

    public MemoryBlock createInitializedBlock(String name, Address start, InputStream is, long length, TaskMonitor monitor, boolean overlay) throws LockException, MemoryConflictException, AddressOverflowException, CancelledException
    Description copied from interface: `Memory`
    Create an initialized memory block based upon a data `InputStream` and add it to this Memory.

    Overlay Blocks: An overlay memory block may be created in two ways:

    - Specifying a `start` address within an existing overlay address space (`overlay` parameter is ignored), or
    - Specifying a `start` address within a physical memory address space and passing `overlay=true`. This use case will force the creation of a new unique overlay address space.
    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 block. If the `start` address is a non-overlay memory address a new overlay address space will be created and the block will have a starting address at the same offset within the new overlay space. If the specified `start` address is an overlay address an overlay block will be created at that overlay address.
    Returns:
      new Initialized 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
      `CancelledException` - user cancelled operation

  - ### createInitializedBlock

    public MemoryBlock createInitializedBlock(String name, Address start, FileBytes fileBytes, long offset, long size, boolean overlay) throws LockException, MemoryConflictException, AddressOverflowException
    Description copied from interface: `Memory`
    Create an initialized memory block using bytes from a `FileBytes` object.

    Overlay Blocks: An overlay memory block may be created in two ways:

    - Specifying a `start` address within an existing overlay address space (`overlay` parameter is ignored), or
    - Specifying a `start` address within a physical memory address space and passing `overlay=true`. This use case will force the creation of a new unique overlay address space.
    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 block. If the `start` address is a non-overlay memory address a new overlay address space will be created and the block will have a starting address at the same offset within the new overlay space. If the specified `start` address is an overlay address an overlay block will be created at that overlay address.
    Returns:
      new Initialized 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

  - ### createInitializedBlock

    public MemoryBlock createInitializedBlock(String name, Address start, long size, byte initialValue, TaskMonitor monitor, boolean overlay) throws LockException, MemoryConflictException, AddressOverflowException, CancelledException
    Description copied from interface: `Memory`
    Create an initialized memory block initialized and add it to this Memory. All bytes will be initialized to the specified value (NOTE: use of zero as the initial value is encouraged for reduced storage).

    Overlay Blocks: An overlay memory block may be created in two ways:

    - Specifying a `start` address within an existing overlay address space (`overlay` parameter is ignored), or
    - Specifying a `start` address within a physical memory address space and passing `overlay=true`. This use case will force the creation of a new unique overlay address space.
    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 block. If the `start` address is a non-overlay memory address a new overlay address space will be created and the block will have a starting address at the same offset within the new overlay space. If the specified `start` address is an overlay address an overlay block will be created at that overlay address.
    Returns:
      new Initialized 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
      `CancelledException` - user cancelled operation

  - ### createUninitializedBlock

    public MemoryBlock createUninitializedBlock(String name, Address start, long size, boolean overlay) throws LockException, MemoryConflictException, AddressOverflowException
    Description copied from interface: `Memory`
    Create an uninitialized memory block and add it to this Memory.

    Overlay Blocks: An overlay memory block may be created in two ways:

    - Specifying a `start` address within an existing overlay address space (`overlay` parameter is ignored), or
    - Specifying a `start` address within a physical memory address space and passing `overlay=true`. This use case will force the creation of a new unique overlay address space.
    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 block. If the `start` address is a non-overlay memory address a new overlay address space will be created and the block will have a starting address at the same offset within the new overlay space. If the specified `start` address is an overlay address an overlay block will be created at that overlay address.
    Returns:
      new Uninitialized 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

  - ### createBitMappedBlock

    public MemoryBlock createBitMappedBlock(String name, Address start, Address mappedAddress, long length, boolean overlay) throws LockException, MemoryConflictException, AddressOverflowException, IllegalArgumentException
    Description copied from interface: `Memory`
    Create a bit-mapped overlay memory block and add it to this Memory. Each byte address within the resulting memory block will correspond to a single bit location within the mapped region specified by `mappedAddress`.

    Overlay Blocks: An overlay memory block may be created in two ways:

    - Specifying a `start` address within an existing overlay address space (`overlay` parameter is ignored), or
    - Specifying a `start` address within a physical memory address space and passing `overlay=true`. This use case will force the creation of a new unique overlay address space.
    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 block. If the `start` address is a non-overlay memory address a new overlay address space will be created and the block will have a starting address at the same offset within the new overlay space. If the specified `start` address is an overlay address an overlay block will be created at that overlay address.
    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
      `MemoryConflictException` - if the new block overlaps with a previous block
      `AddressOverflowException` - if block specification exceeds bounds of address space
      `IllegalArgumentException` - if invalid block name specified

  - ### createByteMappedBlock

    public MemoryBlock createByteMappedBlock(String name, Address start, Address mappedAddress, long length, ByteMappingScheme byteMappingScheme, boolean overlay) throws LockException, MemoryConflictException, AddressOverflowException, IllegalArgumentException
    Description copied from interface: `Memory`
    Create a byte-mapped memory block and add it to this memory. Each byte address within the resulting memory block will correspond to a byte within the mapped region specified by `mappedAddress`. While a 1:1 byte-mapping is the default, a specific byte-mapping ratio may be specified.

    Overlay Blocks: An overlay memory block may be created in two ways:

    - Specifying a `start` address within an existing overlay address space (`overlay` parameter is ignored), or
    - Specifying a `start` address within a physical memory address space and passing `overlay=true`. This use case will force the creation of a new unique overlay address space.
    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 block. If the `start` address is a non-overlay memory address a new overlay address space will be created and the block will have a starting address at the same offset within the new overlay space. If the specified `start` address is an overlay address an overlay block will be created at that overlay address.
    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
      `IllegalArgumentException` - if invalid block name

  - ### createBlock

    public MemoryBlock createBlock(MemoryBlock block, String name, Address start, long length) throws LockException, MemoryConflictException, AddressOverflowException
    Description copied from interface: `Memory`
    Creates a MemoryBlock at the given address with the same properties as block, and adds it to this Memory. Initialized Default blocks will have block filled with 0's. Method will only create physical space blocks and will not create an overlay block.
    Specified by:
      `createBlock` in interface `Memory`
    Parameters:
      `block` - source block
      `name` - block name (See `Memory.isValidMemoryBlockName(String)` for naming rules).
      `start` - start of the block
      `length` - the size of the new block.
    Returns:
      new block
    Throws:
      `LockException` - if exclusive lock not in place (see haveLock())
      `MemoryConflictException` - if block specification conflicts with an existing block
      `AddressOverflowException` - if block specification exceeds bounds of address space

  - ### 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`
    Returns the memory size in bytes.
    Specified by:
      `getSize` in interface `Memory`
    Returns:
      the memory size in bytes

  - ### moveBlock

    public void moveBlock(MemoryBlock block, Address newStartAddr, TaskMonitor monitor) throws LockException, MemoryBlockException, MemoryConflictException, AddressOverflowException
    Description copied from interface: `Memory`
    Move the memory block containing source address to the destination address.
    Specified by:
      `moveBlock` in interface `Memory`
    Parameters:
      `block` - block to be moved
      `newStartAddr` - new start address for block
      `monitor` - task monitor so the move block can be canceled
    Throws:
      `LockException` - if exclusive lock not in place (see haveLock())
      `MemoryBlockException` - if block movement is not permitted
      `MemoryConflictException` - if move would cause blocks to overlap.
      `AddressOverflowException` - if block movement would violate bounds of address space

  - ### split

    public void split(MemoryBlock block, Address addr) throws MemoryBlockException, LockException
    Description copied from interface: `Memory`
    Split a block at the given addr and create a new block starting at addr.
    Specified by:
      `split` in interface `Memory`
    Parameters:
      `block` - block to be split into two
      `addr` - address (within block) that will be the start of new block
    Throws:
      `MemoryBlockException` - memory split not permitted
      `LockException` - if exclusive lock not in place (see haveLock())

  - ### join

    public MemoryBlock join(MemoryBlock blockOne, MemoryBlock blockTwo) throws LockException, MemoryBlockException
    Description copied from interface: `Memory`
    Join the two blocks to create a single memory block. IMPORTANT! When done, both blockOne and blockTwo should no longer be used.
    Specified by:
      `join` in interface `Memory`
    Parameters:
      `blockOne` - block to be combined with blockTwo
      `blockTwo` - block to be combined with blockOne
    Returns:
      new block
    Throws:
      `LockException` - if exclusive lock not in place (see haveLock())
      `MemoryBlockException` - thrown if the blocks are not contiguous in the address space,

  - ### convertToInitialized

    public MemoryBlock convertToInitialized(MemoryBlock uninitializedBlock, byte initialValue) throws LockException, MemoryBlockException
    Description copied from interface: `Memory`
    Convert an existing uninitialized block with an initialized block.
    Specified by:
      `convertToInitialized` in interface `Memory`
    Parameters:
      `uninitializedBlock` - uninitialized block to convert
      `initialValue` - initial value for the bytes
    Returns:
      the converted block
    Throws:
      `LockException` - if exclusive lock not in place (see haveLock())
      `MemoryBlockException` - if there is no block in memory at the same address as block or if the block lengths are not the same.

  - ### convertToUninitialized

    public MemoryBlock convertToUninitialized(MemoryBlock itializedBlock) throws MemoryBlockException, LockException
    Description copied from interface: `Memory`
    Convert an existing initialized block with an uninitialized block. Block will discard any associated memory bytes and drop source info.
    Specified by:
      `convertToUninitialized` in interface `Memory`
    Parameters:
      `itializedBlock` - uninitialized block to convert
    Returns:
      the converted block
    Throws:
      `MemoryBlockException` - if there is no block in memory at the same address as block or if the block lengths are not the same.
      `LockException` - if exclusive lock not in place (see haveLock())

  - ### 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. Search is performed over loaded memory only.
    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.
      `monitor` - the monitor
    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.
      `monitor` - the monitor
    Returns:
      The address of where the first match is found. Null is returned if there is no match.

  - ### getByte

    public byte getByte(Address addr) throws MemoryAccessException
    Description copied from interface: `Memory`
    Get byte at addr.
    Specified by:
      `getByte` in interface `Memory`
    Specified by:
      `getByte` in interface `MemoryAdapter`
    Parameters:
      `addr` - the Address of the byte.
    Returns:
      the byte.
    Throws:
      `MemoryAccessException` - if the address is not contained in any memory block.

  - ### getBytes

    public int getBytes(Address addr, byte[] b, int off, int len) 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.
      `b` - the byte array to populate.
      `off` - the offset into dest to place the bytes.
      `len` - 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.

  - ### setByte

    public void setByte(Address addr, byte value) throws MemoryAccessException
    Description copied from interface: `Memory`
    Write byte at addr.
    Specified by:
      `setByte` in interface `Memory`
    Specified by:
      `setByte` in interface `MemoryAdapter`
    Parameters:
      `addr` - the Address of the byte.
      `value` - the data 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.

  - ### createFileBytes

    public FileBytes createFileBytes(String filename, long offset, long size, InputStream is, TaskMonitor monitor) throws IOException, CancelledException
    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. Caller is responsible for closing input stream upon return.
      `monitor` - task monitor
    Returns:
      a FileBytes that was created to access the bytes.
    Throws:
      `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

    public 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

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

  - ### deleteFileBytes

    public boolean deleteFileBytes(FileBytes fileBytes) throws IOException
    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:
      `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:
      `IOException` - if there was an error updating the database.

  - ### contains

    public boolean contains(Address addr)
    Description copied from interface: `AddressSetView`
    Test if the address is contained within this set.
    Specified by:
      `contains` in interface `AddressSetView`
    Parameters:
      `addr` - address to test.
    Returns:
      true if addr exists in the set, false otherwise.

  - ### contains

    public boolean contains(Address start, Address end)
    Description copied from interface: `AddressSetView`
    Test if the given address range is contained in this set.

    The specified start and end addresses must form a valid range within a single `AddressSpace`.

    Specified by:
      `contains` in interface `AddressSetView`
    Parameters:
      `start` - the first address in the range.
      `end` - the last address in the range.
    Returns:
      true if entire range is contained within the set, false otherwise.

  - ### contains

    public boolean contains(AddressSetView set)
    Description copied from interface: `AddressSetView`
    Test if the given address set is a subset of this set.
    Specified by:
      `contains` in interface `AddressSetView`
    Parameters:
      `set` - the set to test.
    Returns:
      true if the entire set is contained within this set, false otherwise.

  - ### isEmpty

    public boolean isEmpty()
    Specified by:
      `isEmpty` in interface `AddressSetView`
    Returns:
      true if this set is empty.

  - ### getMinAddress

    public Address getMinAddress()
    Description copied from interface: `AddressSetView`
    Get the minimum address for this address set.

    NOTE: An `AddressRange` should generally not be formed using this address and `AddressSetView.getMaxAddress()` since it may span multiple `AddressSpace`s.

    Specified by:
      `getMinAddress` in interface `AddressSetView`
    Returns:
      the minimum address for this set. Returns null if the set is empty.

  - ### getMaxAddress

    public Address getMaxAddress()
    Description copied from interface: `AddressSetView`
    Get the maximum address for this address set.

    NOTE: An `AddressRange` should generally not be formed using this address and `AddressSetView.getMaxAddress()` since it may span multiple `AddressSpace`s.

    Specified by:
      `getMaxAddress` in interface `AddressSetView`
    Returns:
      the maximum address for this set. Returns null if the set is empty.

  - ### getNumAddressRanges

    public int getNumAddressRanges()
    Specified by:
      `getNumAddressRanges` in interface `AddressSetView`
    Returns:
      the number of address ranges in this set.

  - ### getAddressRanges

    public AddressRangeIterator getAddressRanges()
    Specified by:
      `getAddressRanges` in interface `AddressSetView`
    Returns:
      an iterator over the address ranges in this address set.

  - ### 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`
    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 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`
    Parameters:
      `start` - the address the first range should contain.
      `forward` - true iterators forward, false backwards
    Returns:
      the AddressRange iterator

  - ### iterator

    public Iterator<AddressRange> iterator()
    Description copied from interface: `AddressSetView`
    Returns an iterator over the address ranges in this address set.
    Specified by:
      `iterator` in interface `AddressSetView`
    Specified by:
      `iterator` in interface `Iterable<AddressRange>`

  - ### iterator

    public 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`
    Parameters:
      `forward` - the ranges are returned from lowest to highest, otherwise from highest to lowest
    Returns:
      an iterator over all the address ranges in the set.

  - ### iterator

    public 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 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`
    Parameters:
      `start` - the address that the first range should contain.
      `forward` - true iterators forward, false backwards
    Returns:
      the AddressRange iterator

  - ### getNumAddresses

    public long getNumAddresses()
    Specified by:
      `getNumAddresses` in interface `AddressSetView`
    Returns:
      the number of addresses in this set.

  - ### 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`
    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`
    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`
    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.

    The specified start and end addresses must form a valid range within a single `AddressSpace`.

    Specified by:
      `intersects` in interface `AddressSetView`
    Parameters:
      `start` - start of range
      `end` - end of range
    Returns:
      true if the given range intersects this address set.

  - ### intersect

    public AddressSet intersect(AddressSetView view)
    Description copied from interface: `AddressSetView`
    Computes the intersection of this address set with the given address set.

    This method does not modify this address set.

    Specified by:
      `intersect` in interface `AddressSetView`
    Parameters:
      `view` - the address set to intersect with.
    Returns:
      AddressSet a new address set that contains all addresses that are contained in both this set and the given set.

  - ### intersectRange

    public AddressSet intersectRange(Address start, Address end)
    Description copied from interface: `AddressSetView`
    Computes the intersection of this address set with the given address range.

    This method does not modify this address set. The specified start and end addresses must form a valid range within a single `AddressSpace`.

    Specified by:
      `intersectRange` in interface `AddressSetView`
    Parameters:
      `start` - start of range
      `end` - end of range
    Returns:
      AddressSet a new address set that contains all addresses that are contained in both this set and the given range.

  - ### union

    public AddressSet union(AddressSetView addrSet)
    Description copied from interface: `AddressSetView`
    Computes the union of this address set with the given address set.

    This method does not change this address set.

    Specified by:
      `union` in interface `AddressSetView`
    Parameters:
      `addrSet` - The address set to be unioned with this address set.
    Returns:
      AddressSet A new address set which contains all the addresses from both this set and the given set.

  - ### subtract

    public AddressSet subtract(AddressSetView addrSet)
    Description copied from interface: `AddressSetView`
    Computes the difference of this address set with the given address set (this - set).

    Note that this is not the same as (set - this). This method does not change this address set.

    Specified by:
      `subtract` in interface `AddressSetView`
    Parameters:
      `addrSet` - the set to subtract from this set.
    Returns:
      AddressSet a new address set which contains all the addresses that are in this set, but not in the given 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`
    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

  - ### hasSameAddresses

    public boolean hasSameAddresses(AddressSetView view)
    Description copied from interface: `AddressSetView`
    Returns true if the given address set contains the same set of addresses as this set.
    Specified by:
      `hasSameAddresses` in interface `AddressSetView`
    Parameters:
      `view` - the address set to compare.
    Returns:
      true if the given set contains the same addresses as this set.

  - ### getFirstRange

    public AddressRange getFirstRange()
    Description copied from interface: `AddressSetView`
    Returns the first range in this set or null if the set is empty
    Specified by:
      `getFirstRange` in interface `AddressSetView`
    Returns:
      the first range in this set or null if the set is empty

  - ### getLastRange

    public AddressRange getLastRange()
    Description copied from interface: `AddressSetView`
    Returns the last range in this set or null if the set is empty
    Specified by:
      `getLastRange` in interface `AddressSetView`
    Returns:
      the last range in this set or null if the set is empty

  - ### getRangeContaining

    public AddressRange getRangeContaining(Address address)
    Description copied from interface: `AddressSetView`
    Returns the range that contains the given address
    Specified by:
      `getRangeContaining` in interface `AddressSetView`
    Parameters:
      `address` - the address for which to find a range.
    Returns:
      the range that contains the given address.

  - ### findFirstAddressInCommon

    public Address findFirstAddressInCommon(AddressSetView set)
    Description copied from interface: `AddressSetView`
    Finds the first address in this collection that is also in the given addressSet.
    Specified by:
      `findFirstAddressInCommon` in interface `AddressSetView`
    Parameters:
      `set` - the addressSet to search for the first (lowest) common address.
    Returns:
      the first address that is contained in this set and the given set.