Class DBTraceData
- All Implemented Interfaces:
Settings,CodeUnit,Data,MemBuffer,MemBufferMixin,PropertySet,DBTraceCodeUnitAdapter,DBTraceDataAdapter,DBTraceDefinedDataAdapter,TraceCodeUnit,TraceData,TraceAddressSnapRange,DataAdapterFromDataType,DataAdapterFromSettings,DataAdapterMinimal,BoundedShape<TraceAddressSnapRange>,BoundingShape<TraceAddressSnapRange>,Rectangle2D<Address,Long, TraceAddressSnapRange>
-
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
FieldsModifier and TypeFieldDescriptionprotected DataTypeprotected AbstractDBTraceDataComponent[]protected DataTypeprotected Settingsprotected InternalTracePlatformFields inherited from class ghidra.trace.database.listing.AbstractDBTraceCodeUnit
byteCache, spaceFields 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_PROPERTYFields inherited from interface ghidra.trace.util.DataAdapterMinimal
DATA_OP_INDEX, EMPTY_INT_ARRAYFields inherited from interface ghidra.trace.database.listing.DBTraceDataAdapter
EMPTY_STRING_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionDBTraceData(DBTraceCodeSpace space, DBTraceAddressSnapRangePropertyMapTree<DBTraceData, ?> tree, DBCachedObjectStore<?> store, DBRecord record) Construct a data unit -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Delete this code unitTODO: Document me Note this will always be called with the write lockprotected voidfresh(boolean created) Extension point: Called when the object's fields are populated.If the dataType is a typeDef, then the typeDef's base type is returned, otherwise, the datatType is returned.static DataTypeGet the base data type of the given data type, following typedefs recursivelyintGet the index of this component in its parentintGet this data's component level in its hierarchy of components.int[]Get the component path if this is a component.Returns the component path name (dot notation) for this fieldGet the Data type for the data.protected intIf this unit's data type has a fixed length, get that lengthReturns the underlying default settings for these settings or null if there are noneGet the field name of this data item if it is "inside" another data item, otherwise return null.Get the language of this code unitGet the immediate parent data item of this data item or null if this data item is not contained in another data item.intGet the offset of this Data item from the start of its immediate parent.Returns the full path name (dot notation) for this field.getPathName(StringBuilder builder, boolean includeRootSymbol) Get the platform for this unitprotected DBTraceDataGet the value of this record Note that the value is sometimes the record itself, i.e., this method returnsthis.getRoot()Get the highest level Data item in a hierarchy of structures containing this component.intGet the offset of this Data item from the start of the root data item of some hierarchy of structures.getSettingsSpace(boolean createIfAbsent) Get the same space from the internal settings adapterprotected voidset(InternalTracePlatform platform, long dataTypeID) Set the fields of this recordvoidsetEndSnap(long endSnap) Set the end snap of this code unitprotected voidsetRecordValue(DBTraceData value) Set the value of this record Note that the value is sometimes the record itself.toString()Methods inherited from class ghidra.trace.database.listing.AbstractDBTraceCodeUnit
getAddress, getBytes, getEndSnap, getLength, getMaxAddress, getStartSnap, getThread, getTraceMethods inherited from class ghidra.trace.database.map.DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData
doSetLifespan, doSetRange, equals, getBounds, getLifespan, getParentKey, getRange, getShape, getSpace, hashCode, setParentKey, setShape, shapeEqualsMethods inherited from class ghidra.util.database.spatial.DBTreeDataRecord
asEntry, getDataCountMethods 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
getComment, getCommentAsArray, getLength, getMaxAddress, setComment, setCommentAsArrayMethods inherited from interface ghidra.program.model.listing.Data
isImmutableSettingsMethods inherited from interface ghidra.trace.util.DataAdapterFromDataType
doToString, getAddress, getDefaultLabelPrefix, getDefaultValueRepresentation, getMnemonicString, getScalar, getValue, getValueClass, hasStringValue, isArray, isDynamic, isPointer, isStructure, isUnionMethods inherited from interface ghidra.trace.util.DataAdapterFromSettings
isConstant, isVolatile, isWritableMethods inherited from interface ghidra.trace.util.DataAdapterMinimal
getNumOperands, getPrimarySymbolOrDynamicNameMethods 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, getTrace, getVoidProperty, hasProperty, isBigEndian, propertyNames, removeExternalReference, removeMnemonicReference, removeOperandReference, removeProperty, setComment, setCommentAsArray, setPrimaryMemoryReference, setProperty, setProperty, setProperty, setProperty, setProperty, setRegisterReference, setStackReference, setTypedPropertyMethods inherited from interface ghidra.trace.database.listing.DBTraceDataAdapter
addValueReference, clearAllSettings, clearSetting, getLong, getNames, getSettingsDefinition, getString, getValue, getValueReferences, hasMutability, isChangeAllowed, isEmpty, removeValueReference, setLong, setString, setValueMethods inherited from interface ghidra.trace.database.listing.DBTraceDefinedDataAdapter
doGetComponent, getComponent, getComponent, getComponentAt, getComponentContaining, getComponentsContaining, getNumComponents, getPrimitiveAt, isDefinedMethods inherited from interface ghidra.program.model.mem.MemBuffer
getAddress, getInputStream, getInputStream, getUnsignedByte, getUnsignedInt, getUnsignedShort, getVarLengthInt, getVarLengthUnsignedInt, isInitializedMemoryMethods inherited from interface ghidra.program.model.mem.MemBufferMixin
getBigInteger, getByte, getBytes, 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.docking.settings.Settings
getSuggestedValuesMethods inherited from interface ghidra.trace.model.TraceAddressSnapRange
description, getX1, getX2, getY1, getY2, immutableMethods inherited from interface ghidra.trace.model.listing.TraceCodeUnit
getBounds, getBytes, getEndSnap, getLifespan, getRange, getStartSnap, getThread
-
Field Details
-
platform
-
dataType
-
baseDataType
-
defaultSettings
-
componentCache
-
-
Constructor Details
-
DBTraceData
public DBTraceData(DBTraceCodeSpace space, DBTraceAddressSnapRangePropertyMapTree<DBTraceData, ?> tree, DBCachedObjectStore<?> store, DBRecord record) Construct a data unit- Parameters:
space- the spacetree- the storage R*-Treestore- the object storerecord- the record
-
-
Method Details
-
fresh
Description copied from class:DBAnnotatedObjectExtension point: Called when the object's fields are populated.This provides an opportunity for the object to initialize any non-database-backed fields that depend on the database-backed fields. Note that its use may indicate a situation better solved by a custom
DBCachedObjectStoreFactory.DBFieldCodec. If both the database-backed and non-database-backed fields are used frequently, then a codec may not be indicated. If the database-backed fields are only used in this method or to encode another frequently-used field, then a codec is likely better.For a new object, the database-backed fields remain at their initial values. They will be saved after this method returns, so they may be further initialized with custom logic.
For an object loaded from the database, the database-backed fields are already populated from the record when this method is called. They are not automatically saved after this method returns. This method should not further initialize database-backed fields in this case.
- Overrides:
freshin classDBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<DBTraceData>- Parameters:
created-truewhen object is being created, orfalsewhen it is being loaded.- Throws:
IOException- if further initialization fails.
-
setRecordValue
Description copied from class:DBTreeDataRecordSet the value of this record Note that the value is sometimes the record itself. In this case, this method expectsvalueto benulland does nothing. SeeSpatialMap.put(BoundedShape, Object)for more details of this pattern.- Specified by:
setRecordValuein classDBTreeDataRecord<TraceAddressSnapRange,TraceAddressSnapRange, DBTraceData> - Parameters:
value- the record's new value
-
getRecordValue
Description copied from class:DBTreeDataRecordGet the value of this record Note that the value is sometimes the record itself, i.e., this method returnsthis. SeeSpatialMap.put(BoundedShape, Object)for more details of this pattern.- Specified by:
getRecordValuein classDBTreeDataRecord<TraceAddressSnapRange,TraceAddressSnapRange, DBTraceData> - Returns:
- the record's value
-
set
Set the fields of this record- Parameters:
platform- the platformdataTypeID- the data type id
-
getDataTypeLength
protected int getDataTypeLength()If this unit's data type has a fixed length, get that length- Returns:
- the length, or -1
-
getBaseDataType
Get the base data type of the given data type, following typedefs recursively- Parameters:
dt- the data type- Returns:
- the base data type
-
getPlatform
Description copied from interface:TraceCodeUnitGet the platform for this unit- Specified by:
getPlatformin interfaceTraceCodeUnit- Returns:
- the platform
-
delete
public void delete()Description copied from interface:TraceCodeUnitDelete this code unit- Specified by:
deletein interfaceTraceCodeUnit
-
setEndSnap
public void setEndSnap(long endSnap) Description copied from interface:TraceCodeUnitSet the end snap of this code unit- Specified by:
setEndSnapin interfaceTraceCodeUnit- Overrides:
setEndSnapin classAbstractDBTraceCodeUnit<DBTraceData>- Parameters:
endSnap- the last snap of this unit's lifespan
-
getLanguage
Description copied from interface:TraceCodeUnitGet the language of this code unitCurrently, for data units, this is always the base or "host" language of the trace. For instructions, this may be a guest language.
- Specified by:
getLanguagein interfaceTraceCodeUnit- Returns:
- the language
-
toString
- Overrides:
toStringin classDBTreeDataRecord<TraceAddressSnapRange,TraceAddressSnapRange, DBTraceData>
-
getDataType
Description copied from interface:DataGet the Data type for the data.- Specified by:
getDataTypein interfaceData- Returns:
- the data type
-
getBaseDataType
Description copied from interface:DataIf the dataType is a typeDef, then the typeDef's base type is returned, otherwise, the datatType is returned.- Specified by:
getBaseDataTypein interfaceData- Returns:
- the data type
-
getParent
Description copied from interface:DataGet the immediate parent data item of this data item or null if this data item is not contained in another data item.- Specified by:
getParentin interfaceData- Specified by:
getParentin interfaceDBTraceDefinedDataAdapter- Returns:
- the data
-
getRoot
Description copied from interface:DataGet the highest level Data item in a hierarchy of structures containing this component.- Specified by:
getRootin interfaceData- Specified by:
getRootin interfaceDBTraceDataAdapter- Specified by:
getRootin interfaceDBTraceDefinedDataAdapter- Returns:
- the data
-
getRootOffset
public int getRootOffset()Description copied from interface:DataGet the offset of this Data item from the start of the root data item of some hierarchy of structures.- Specified by:
getRootOffsetin interfaceData- Returns:
- the offset
-
getParentOffset
public int getParentOffset()Description copied from interface:DataGet the offset of this Data item from the start of its immediate parent.- Specified by:
getParentOffsetin interfaceData- Returns:
- the offset
-
doGetComponentCache
Description copied from interface:DBTraceDefinedDataAdapterTODO: Document me Note this will always be called with the write lock- Specified by:
doGetComponentCachein interfaceDBTraceDefinedDataAdapter- Returns:
- the new or existing component cache
-
getComponentPath
public int[] getComponentPath()Description copied from interface:DataGet the component path if this is a component. The component path is an array of integers that represent each index in the tree of data items. Top level data items have an empty array for their component path.- Specified by:
getComponentPathin interfaceData- Returns:
- the path
-
getComponentIndex
public int getComponentIndex()Description copied from interface:DataGet the index of this component in its parent- Specified by:
getComponentIndexin interfaceData- Returns:
- -1 if this data item is not a component of another data item.
-
getComponentLevel
public int getComponentLevel()Description copied from interface:DataGet this data's component level in its hierarchy of components.- Specified by:
getComponentLevelin interfaceData- Returns:
- the level of this data item with 0 being the level of top data items.
-
getFieldName
Description copied from interface:DataGet the field name of this data item if it is "inside" another data item, otherwise return null.- Specified by:
getFieldNamein interfaceData- Returns:
- the name of this data as known from some parent data item or null if this data item is not a component of another data item.
-
getPathName
Description copied from interface:DataReturns the full path name (dot notation) for this field. This includes the symbol name at this address.- Specified by:
getPathNamein interfaceData- Returns:
- the path name
-
getComponentPathName
Description copied from interface:DataReturns the component path name (dot notation) for this field- Specified by:
getComponentPathNamein interfaceData- Returns:
- the component path name
-
getPathName
- Specified by:
getPathNamein interfaceDBTraceDefinedDataAdapter
-
getSettingsSpace
Description copied from interface:DBTraceDataAdapterGet the same space from the internal settings adapter- Specified by:
getSettingsSpacein interfaceDBTraceDataAdapter- Parameters:
createIfAbsent- true to create the space if its not already present- Returns:
- the space or null
-
getDefaultSettings
Description copied from interface:SettingsReturns the underlying default settings for these settings or null if there are none- Specified by:
getDefaultSettingsin interfaceSettings- Returns:
- underlying default settings or null
-