Package ghidra.trace.database.listing
Class AbstractDBTraceCodeUnit<T extends AbstractDBTraceCodeUnit<T>>
java.lang.Object
ghidra.program.database.DatabaseObject
ghidra.util.database.DBAnnotatedObject
ghidra.util.database.spatial.DBTreeRecord<TraceAddressSnapRange,TraceAddressSnapRange>
ghidra.util.database.spatial.DBTreeDataRecord<TraceAddressSnapRange,TraceAddressSnapRange,T>
ghidra.trace.database.map.DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<T>
ghidra.trace.database.listing.AbstractDBTraceCodeUnit<T>
- Type Parameters:
T- the implementation type of this unit
- All Implemented Interfaces:
CodeUnit,MemBuffer,MemBufferMixin,PropertySet,DBTraceCodeUnitAdapter,TraceCodeUnit,TraceAddressSnapRange,BoundedShape<TraceAddressSnapRange>,BoundingShape<TraceAddressSnapRange>,Rectangle2D<Address,Long, TraceAddressSnapRange>
- Direct Known Subclasses:
DBTraceData,DBTraceInstruction
public abstract class AbstractDBTraceCodeUnit<T extends AbstractDBTraceCodeUnit<T>>
extends DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<T>
implements DBTraceCodeUnitAdapter
An abstract implementation of a table-backed code unit
This is implemented as a data entry in an address-snap-range property map. This is not suitable for data components, nor for undefined units.
-
Nested Class Summary
Nested classes/interfaces inherited from class ghidra.util.database.spatial.DBTreeDataRecord
DBTreeDataRecord.RecordEntry<DS extends BoundedShape<NS>,NS extends BoundingShape<NS>, T> -
Field Summary
FieldsFields inherited from class ghidra.trace.database.map.DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData
lifespan, range, treeFields inherited from class ghidra.program.database.DatabaseObject
keyFields inherited from interface ghidra.program.model.listing.CodeUnit
COMMENT_PROPERTY, DEFINED_DATA_PROPERTY, EOL_COMMENT, INSTRUCTION_PROPERTY, MNEMONIC, PLATE_COMMENT, POST_COMMENT, PRE_COMMENT, REPEATABLE_COMMENT, SPACE_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionAbstractDBTraceCodeUnit(DBTraceCodeSpace space, DBTraceAddressSnapRangePropertyMapTree<T, ?> tree, DBCachedObjectStore<?> store, DBRecord record) Construct a code unit -
Method Summary
Modifier and TypeMethodDescriptionGet the Address which corresponds to the offset 0.intgetBytes(ByteBuffer buffer, int addressOffset) Read bytes starting at this unit's address plus the given offset into the given bufferlongGet the end snap of this code unitintGet length of this code unit.Returns the ending address for this code unit..longGet the start snap of this code unitGet the thread associated with this code unitgetTrace()Get the trace in which this code unit existsvoidsetEndSnap(long endSnap) Set the end snap of this code unitMethods inherited from class ghidra.trace.database.map.DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData
doSetLifespan, doSetRange, equals, fresh, getBounds, getLifespan, getParentKey, getRange, getShape, getSpace, hashCode, setParentKey, setShape, shapeEqualsMethods inherited from class ghidra.util.database.spatial.DBTreeDataRecord
asEntry, getDataCount, getRecordValue, setRecordValue, toStringMethods inherited from class ghidra.util.database.DBAnnotatedObject
doRefresh, doUpdateAll, doUpdated, doWrite, getObjectKey, getTableName, isDeleted, refresh, refresh, update, update, update, updateMethods inherited from class ghidra.program.database.DatabaseObject
checkDeleted, checkIsValid, checkIsValid, getKey, isDeleted, isInvalid, keyChanged, setDeleted, setInvalid, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.program.model.listing.CodeUnit
getAddress, getComment, getCommentAsArray, getMnemonicString, getNumOperands, getScalar, setComment, setCommentAsArrayMethods inherited from interface ghidra.trace.database.listing.DBTraceCodeUnitAdapter
addMnemonicReference, addOperandReference, compareTo, contains, getAddressSpace, getAddressString, getBytes, getBytesInCodeUnit, getComment, getCommentAsArray, getExternalReference, getIntProperty, getLabel, getMemory, getMinAddress, getMnemonicReferences, getObjectProperty, getOperandReferences, getPrimaryReference, getPrimarySymbol, getProgram, getProperty, getReferenceIteratorTo, getReferencesFrom, getStringProperty, getSymbols, getVoidProperty, hasProperty, isBigEndian, propertyNames, removeExternalReference, removeMnemonicReference, removeOperandReference, removeProperty, setComment, setCommentAsArray, setPrimaryMemoryReference, setProperty, setProperty, setProperty, setProperty, setProperty, setRegisterReference, setStackReference, setTypedPropertyMethods inherited from interface ghidra.program.model.mem.MemBuffer
getInputStream, getInputStream, getUnsignedByte, getUnsignedInt, getUnsignedShort, getVarLengthInt, getVarLengthUnsignedInt, isInitializedMemoryMethods inherited from interface ghidra.program.model.mem.MemBufferMixin
getBigInteger, getByte, getBytes, getBytesInFull, getInt, getLong, getShortMethods inherited from interface ghidra.util.database.spatial.rect.Rectangle2D
computeAreaIntersection, computeAreaUnionBounds, computeCentroidDistance, contains, contains, doEquals, doHashCode, enclosedBy, encloses, getArea, getCenter, getMargin, intersection, intersects, unionBoundsMethods inherited from interface ghidra.trace.model.TraceAddressSnapRange
description, getX1, getX2, getY1, getY2, immutableMethods inherited from interface ghidra.trace.model.listing.TraceCodeUnit
delete, getBounds, getLanguage, getLifespan, getPlatform, getRange
-
Field Details
-
space
-
byteCache
-
-
Constructor Details
-
AbstractDBTraceCodeUnit
public AbstractDBTraceCodeUnit(DBTraceCodeSpace space, DBTraceAddressSnapRangePropertyMapTree<T, ?> tree, DBCachedObjectStore<?> store, DBRecord record) Construct a code unit- Parameters:
space- the spacetree- the storage R*-Treestore- the object storerecord- the record
-
-
Method Details
-
getAddress
Description copied from interface:MemBufferGet the Address which corresponds to the offset 0.- Specified by:
getAddressin interfaceMemBuffer- Returns:
- the current address of offset 0.
-
getMaxAddress
Description copied from interface:CodeUnitReturns the ending address for this code unit..- Specified by:
getMaxAddressin interfaceCodeUnit- Returns:
- the ending address for this code unit.
-
getLength
public int getLength()Description copied from interface:CodeUnitGet length of this code unit. NOTE: If aninstruction length-overrideis set this method will return the reduced length. -
getThread
Description copied from interface:TraceCodeUnitGet the thread associated with this code unitA thread is associated with a code unit if it exists in a register space
- Specified by:
getThreadin interfaceTraceCodeUnit- Returns:
- the thread
-
getTrace
Description copied from interface:TraceCodeUnitGet the trace in which this code unit exists- Specified by:
getTracein interfaceDBTraceCodeUnitAdapter- Specified by:
getTracein interfaceTraceCodeUnit- Returns:
- the trace
-
getStartSnap
public long getStartSnap()Description copied from interface:TraceCodeUnitGet the start snap of this code unit- Specified by:
getStartSnapin interfaceTraceCodeUnit- Returns:
- the first snap of this unit's lifespan
-
setEndSnap
public void setEndSnap(long endSnap) Description copied from interface:TraceCodeUnitSet the end snap of this code unit- Specified by:
setEndSnapin interfaceTraceCodeUnit- Parameters:
endSnap- the last snap of this unit's lifespan
-
getEndSnap
public long getEndSnap()Description copied from interface:TraceCodeUnitGet the end snap of this code unit- Specified by:
getEndSnapin interfaceTraceCodeUnit- Returns:
- the last snap of this unit's lifespan
-
getBytes
Description copied from interface:TraceCodeUnitRead bytes starting at this unit's address plus the given offset into the given bufferThis method honors the markers (position and limit) of the destination buffer. Use those markers to control the destination offset and maximum length.
- Specified by:
getBytesin interfaceMemBufferMixin- Specified by:
getBytesin interfaceTraceCodeUnit- Parameters:
buffer- the destination bufferaddressOffset- the offset from this unit's (minimum) address- Returns:
- the number of bytes read
-