Package ghidra.program.database.mem
Class MemoryMapDBAdapterV3
- java.lang.Object
-
- ghidra.program.database.mem.MemoryMapDBAdapterV3
-
public class MemoryMapDBAdapterV3 extends java.lang.Object
MemoryMap adapter for version 3. This version introduces the concept of sub memory blocks and FileBytes
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MemoryMapDBAdapterV3(DBHandle handle, MemoryMapDB memMap, long maxSubBlockSize, boolean create)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MemoryBlockDB
createBlock(java.lang.String name, Address startAddress, long length, int permissions, java.util.List<ghidra.program.database.mem.SubMemoryBlock> splitBlocks)
Creates a new memory block.protected MemoryBlockDB
createFileBytesBlock(java.lang.String name, Address startAddress, long length, FileBytes fileBytes, long offset, int permissions)
Creates a new memory block using a FileBytesprotected void
updateSubBlockRecord(Record record)
Updates the sub memory block record.
-
-
-
Field Detail
-
V3_VERSION
public static final int V3_VERSION
- See Also:
- Constant Field Values
-
TABLE_NAME
public static final java.lang.String TABLE_NAME
- See Also:
- Constant Field Values
-
SUB_BLOCK_TABLE_NAME
public static final java.lang.String SUB_BLOCK_TABLE_NAME
- See Also:
- Constant Field Values
-
V3_NAME_COL
public static final int V3_NAME_COL
- See Also:
- Constant Field Values
-
V3_COMMENTS_COL
public static final int V3_COMMENTS_COL
- See Also:
- Constant Field Values
-
V3_SOURCE_COL
public static final int V3_SOURCE_COL
- See Also:
- Constant Field Values
-
V3_PERMISSIONS_COL
public static final int V3_PERMISSIONS_COL
- See Also:
- Constant Field Values
-
V3_START_ADDR_COL
public static final int V3_START_ADDR_COL
- See Also:
- Constant Field Values
-
V3_LENGTH_COL
public static final int V3_LENGTH_COL
- See Also:
- Constant Field Values
-
V3_SEGMENT_COL
public static final int V3_SEGMENT_COL
- See Also:
- Constant Field Values
-
V3_SUB_PARENT_ID_COL
public static final int V3_SUB_PARENT_ID_COL
- See Also:
- Constant Field Values
-
V3_SUB_TYPE_COL
public static final int V3_SUB_TYPE_COL
- See Also:
- Constant Field Values
-
V3_SUB_LENGTH_COL
public static final int V3_SUB_LENGTH_COL
- See Also:
- Constant Field Values
-
V3_SUB_START_OFFSET_COL
public static final int V3_SUB_START_OFFSET_COL
- See Also:
- Constant Field Values
-
V3_SUB_SOURCE_ID_COL
public static final int V3_SUB_SOURCE_ID_COL
- See Also:
- Constant Field Values
-
V3_SUB_SOURCE_OFFSET_COL
public static final int V3_SUB_SOURCE_OFFSET_COL
- See Also:
- Constant Field Values
-
V3_SUB_TYPE_BIT_MAPPED
public static final byte V3_SUB_TYPE_BIT_MAPPED
- See Also:
- Constant Field Values
-
V3_SUB_TYPE_BYTE_MAPPED
public static final byte V3_SUB_TYPE_BYTE_MAPPED
- See Also:
- Constant Field Values
-
V3_SUB_TYPE_BUFFER
public static final byte V3_SUB_TYPE_BUFFER
- See Also:
- Constant Field Values
-
V3_SUB_TYPE_UNITIALIZED
public static final byte V3_SUB_TYPE_UNITIALIZED
- See Also:
- Constant Field Values
-
V3_SUB_TYPE_FILE_BYTES
public static final byte V3_SUB_TYPE_FILE_BYTES
- See Also:
- Constant Field Values
-
NAME_COL
public static final int NAME_COL
- See Also:
- Constant Field Values
-
COMMENTS_COL
public static final int COMMENTS_COL
- See Also:
- Constant Field Values
-
SOURCE_COL
public static final int SOURCE_COL
- See Also:
- Constant Field Values
-
PERMISSIONS_COL
public static final int PERMISSIONS_COL
- See Also:
- Constant Field Values
-
START_ADDR_COL
public static final int START_ADDR_COL
- See Also:
- Constant Field Values
-
LENGTH_COL
public static final int LENGTH_COL
- See Also:
- Constant Field Values
-
SEGMENT_COL
public static final int SEGMENT_COL
- See Also:
- Constant Field Values
-
SUB_PARENT_ID_COL
public static final int SUB_PARENT_ID_COL
- See Also:
- Constant Field Values
-
SUB_TYPE_COL
public static final int SUB_TYPE_COL
- See Also:
- Constant Field Values
-
SUB_LENGTH_COL
public static final int SUB_LENGTH_COL
- See Also:
- Constant Field Values
-
SUB_START_OFFSET_COL
public static final int SUB_START_OFFSET_COL
- See Also:
- Constant Field Values
-
SUB_SOURCE_ID_COL
public static final int SUB_SOURCE_ID_COL
- See Also:
- Constant Field Values
-
SUB_SOURCE_OFFSET_COL
public static final int SUB_SOURCE_OFFSET_COL
- See Also:
- Constant Field Values
-
SUB_TYPE_BIT_MAPPED
public static final byte SUB_TYPE_BIT_MAPPED
- See Also:
- Constant Field Values
-
SUB_TYPE_BYTE_MAPPED
public static final byte SUB_TYPE_BYTE_MAPPED
- See Also:
- Constant Field Values
-
SUB_TYPE_BUFFER
public static final byte SUB_TYPE_BUFFER
- See Also:
- Constant Field Values
-
SUB_TYPE_UNITIALIZED
public static final byte SUB_TYPE_UNITIALIZED
- See Also:
- Constant Field Values
-
SUB_TYPE_FILE_BYTES
public static final byte SUB_TYPE_FILE_BYTES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MemoryMapDBAdapterV3
public MemoryMapDBAdapterV3(DBHandle handle, MemoryMapDB memMap, long maxSubBlockSize, boolean create) throws VersionException, java.io.IOException
- Throws:
VersionException
java.io.IOException
-
-
Method Detail
-
createBlock
protected MemoryBlockDB createBlock(java.lang.String name, Address startAddress, long length, int permissions, java.util.List<ghidra.program.database.mem.SubMemoryBlock> splitBlocks) throws java.io.IOException
Creates a new memory block.- Parameters:
name
- the name of the blockstartAddress
- the start address of the blocklength
- the length of the blockpermissions
- the permissions for the blocksplitBlocks
- the list of subBlock objects that make up this block- Returns:
- the new MemoryBlock
- Throws:
java.io.IOException
- if a database error occurs
-
createFileBytesBlock
protected MemoryBlockDB createFileBytesBlock(java.lang.String name, Address startAddress, long length, FileBytes fileBytes, long offset, int permissions) throws java.io.IOException, AddressOverflowException
Creates a new memory block using a FileBytes- Parameters:
name
- the name of the blockstartAddress
- the start address of the blocklength
- the length of the blockfileBytes
- theFileBytes
object that provides the bytes for this blockoffset
- the offset into theFileBytes
objectpermissions
- the permissions for the block- Returns:
- the new MemoryBlock
- Throws:
java.io.IOException
- if a database error occursAddressOverflowException
- if block length is too large for the underlying space
-
updateSubBlockRecord
protected void updateSubBlockRecord(Record record) throws java.io.IOException
Updates the sub memory block record.- Parameters:
record
- the record to update.- Throws:
java.io.IOException
- if a database IO error occurs.
-
-