Package ghidra.program.database.mem

# Class MemoryMapDBAdapterV3

java.lang.Object
ghidra.program.database.mem.MemoryMapDBAdapterV3

public class MemoryMapDBAdapterV3 extends Object
MemoryMap adapter for version 3. This version introduces the concept of sub memory blocks and FileBytes

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MemoryMapDBAdapterV3(DBHandle handle, MemoryMapDB memMap, long maxSubBlockSize, boolean create)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected MemoryBlockDB`
  `createBlock(String name, Address startAddress, long length, int permissions, List<ghidra.program.database.mem.SubMemoryBlock> splitBlocks)`
  Creates a new memory block.
  `protected MemoryBlockDB`
  `createFileBytesBlock(String name, Address startAddress, long length, FileBytes fileBytes, long offset, int permissions)`
  Creates a new memory block using a FileBytes
  `protected void`
  `updateSubBlockRecord(DBRecord record)`
  Updates the sub memory block record.

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

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

- ## Constructor Details

  - ### MemoryMapDBAdapterV3

    public MemoryMapDBAdapterV3(DBHandle handle, MemoryMapDB memMap, long maxSubBlockSize, boolean create) throws VersionException, IOException
    Throws:
      `VersionException`
      `IOException`

- ## Method Details

  - ### createBlock

    protected MemoryBlockDB createBlock(String name, Address startAddress, long length, int permissions, List<ghidra.program.database.mem.SubMemoryBlock> splitBlocks) throws IOException
    Creates a new memory block.
    Parameters:
      `name` - the name of the block
      `startAddress` - the start address of the block
      `length` - the length of the block
      `permissions` - the permissions for the block
      `splitBlocks` - the list of subBlock objects that make up this block
    Returns:
      the new MemoryBlock
    Throws:
      `IOException` - if a database error occurs

  - ### createFileBytesBlock

    protected MemoryBlockDB createFileBytesBlock(String name, Address startAddress, long length, FileBytes fileBytes, long offset, int permissions) throws IOException, AddressOverflowException
    Creates a new memory block using a FileBytes
    Parameters:
      `name` - the name of the block
      `startAddress` - the start address of the block
      `length` - the length of the block
      `fileBytes` - the `FileBytes` object that provides the bytes for this block
      `offset` - the offset into the `FileBytes` object
      `permissions` - the permissions for the block
    Returns:
      the new MemoryBlock
    Throws:
      `IOException` - if a database error occurs
      `AddressOverflowException` - if block length is too large for the underlying space

  - ### updateSubBlockRecord

    protected void updateSubBlockRecord(DBRecord record) throws IOException
    Updates the sub memory block record.
    Parameters:
      `record` - the record to update.
    Throws:
      `IOException` - if a database IO error occurs.