Package ghidra.program.database.mem
Class MemoryMapDBAdapterV3
- java.lang.Object
-
- ghidra.program.database.mem.MemoryMapDBAdapterV3
-
public class MemoryMapDBAdapterV3 extends java.lang.ObjectMemoryMap adapter for version 3. This version introduces the concept of sub memory blocks and FileBytes
-
-
Field Summary
Fields Modifier and Type Field Description static intCOMMENTS_COLstatic intLENGTH_COLstatic intNAME_COLstatic intPERMISSIONS_COLstatic intSEGMENT_COLstatic intSOURCE_COLstatic intSTART_ADDR_COLstatic java.lang.StringSUB_BLOCK_TABLE_NAMEstatic intSUB_INT_DATA1_COLSubblock record int data1 usage:BufferSubMemoryBlock- data buffer IDFileBytesSubMemoryBlock- file bytes layered data buffer IDByteMappedSubMemoryBlock- encoded byte mapping schemeBitMappedSubMemoryBlock- (not used) 0UninitializedSubMemoryBlock- (not used) 0static intSUB_LENGTH_COLstatic intSUB_LONG_DATA2_COLSubblock record long data2 usage:BufferSubMemoryBlock- (not used) 0FileBytesSubMemoryBlock- starting byte offset within file bytes bufferByteMappedSubMemoryBlock- encoded mapped source addressBitMappedSubMemoryBlock- encoded mapped source addressUninitializedSubMemoryBlock- (not used) 0static intSUB_PARENT_ID_COLstatic intSUB_START_OFFSET_COLstatic byteSUB_TYPE_BIT_MAPPEDstatic byteSUB_TYPE_BUFFERstatic byteSUB_TYPE_BYTE_MAPPEDstatic intSUB_TYPE_COLstatic byteSUB_TYPE_FILE_BYTESstatic byteSUB_TYPE_UNITIALIZEDstatic java.lang.StringTABLE_NAMEstatic intV3_COMMENTS_COLstatic intV3_LENGTH_COLstatic intV3_NAME_COLstatic intV3_PERMISSIONS_COLstatic intV3_SEGMENT_COLstatic intV3_SOURCE_COLstatic intV3_START_ADDR_COLstatic intV3_SUB_INT_DATA1_COLstatic intV3_SUB_LENGTH_COLstatic intV3_SUB_LONG_DATA2_COLstatic intV3_SUB_PARENT_ID_COLstatic intV3_SUB_START_OFFSET_COLstatic byteV3_SUB_TYPE_BIT_MAPPEDstatic byteV3_SUB_TYPE_BUFFERstatic byteV3_SUB_TYPE_BYTE_MAPPEDstatic intV3_SUB_TYPE_COLstatic byteV3_SUB_TYPE_FILE_BYTESstatic byteV3_SUB_TYPE_UNITIALIZEDstatic intV3_VERSION
-
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 MemoryBlockDBcreateBlock(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 MemoryBlockDBcreateFileBytesBlock(java.lang.String name, Address startAddress, long length, FileBytes fileBytes, long offset, int permissions)Creates a new memory block using a FileBytesprotected voidupdateSubBlockRecord(DBRecord 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_INT_DATA1_COL
public static final int V3_SUB_INT_DATA1_COL
- See Also:
- Constant Field Values
-
V3_SUB_LONG_DATA2_COL
public static final int V3_SUB_LONG_DATA2_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_INT_DATA1_COL
public static final int SUB_INT_DATA1_COL
Subblock record int data1 usage:BufferSubMemoryBlock- data buffer IDFileBytesSubMemoryBlock- file bytes layered data buffer IDByteMappedSubMemoryBlock- encoded byte mapping schemeBitMappedSubMemoryBlock- (not used) 0UninitializedSubMemoryBlock- (not used) 0
- See Also:
- Constant Field Values
-
SUB_LONG_DATA2_COL
public static final int SUB_LONG_DATA2_COL
Subblock record long data2 usage:BufferSubMemoryBlock- (not used) 0FileBytesSubMemoryBlock- starting byte offset within file bytes bufferByteMappedSubMemoryBlock- encoded mapped source addressBitMappedSubMemoryBlock- encoded mapped source addressUninitializedSubMemoryBlock- (not used) 0
- 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:
VersionExceptionjava.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- theFileBytesobject that provides the bytes for this blockoffset- the offset into theFileBytesobjectpermissions- 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(DBRecord 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.
-
-