Package ghidra.trace.database.listing
Interface DBTraceDefinedDataAdapter
- All Superinterfaces:
CodeUnit,Data,DataAdapterFromDataType,DataAdapterFromSettings,DataAdapterMinimal,DBTraceCodeUnitAdapter,DBTraceDataAdapter,MemBuffer,MemBufferMixin,PropertySet,Settings,TraceCodeUnit,TraceData
- All Known Implementing Classes:
AbstractDBTraceDataComponent,DBTraceData,DBTraceDataArrayElementComponent,DBTraceDataCompositeFieldComponent
A base interface for implementations of
TraceData
This behaves somewhat like a mixin, allowing it to be used on defined data units as well as data components, e.g., fields of a struct data unit.
-
Field Summary
Fields 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 -
Method Summary
Modifier and TypeMethodDescriptiondefault DBTraceDefinedDataAdapterdoGetComponent(int[] componentPath, int level) TODO: Document me Note this will always be called with the write lockdefault DBTraceDefinedDataAdaptergetComponent(int index) Returns the immediate n'th component or null if none exists.default DBTraceDefinedDataAdaptergetComponent(int[] componentPath) Get a data item given the index path.default DBTraceDefinedDataAdaptergetComponentAt(int offset) Deprecated.default DBTraceDefinedDataAdaptergetComponentContaining(int offset) Return the first immediate child component that contains the byte at the given offset.getComponentsContaining(int offset) Returns a list of all the immediate child components that contain the byte at the given offset.default intReturn the number of components that make up this data item.Get the immediate parent data item of this data item or null if this data item is not contained in another data item.getPathName(StringBuilder builder, boolean includeRootSymbol) default DBTraceDefinedDataAdaptergetPrimitiveAt(int offset) Returns the primitive component containing this offset (i.e., one that does not have sub-components).getRoot()Get the highest level Data item in a hierarchy of structures containing this component.default booleanReturns true if the data type is defined.Methods inherited from interface ghidra.program.model.listing.CodeUnit
getComment, getCommentAsArray, getLength, getMaxAddress, setComment, setCommentAsArrayMethods inherited from interface ghidra.program.model.listing.Data
getBaseDataType, getComponentIndex, getComponentLevel, getComponentPath, getComponentPathName, getDataType, getFieldName, getParentOffset, getPathName, getRootOffset, 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, getSettingsSpace, getString, getValue, getValueReferences, hasMutability, isChangeAllowed, isEmpty, removeValueReference, setLong, setString, setValueMethods 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.docking.settings.Settings
getDefaultSettings, getSuggestedValuesMethods inherited from interface ghidra.trace.model.listing.TraceCodeUnit
delete, getBounds, getBytes, getEndSnap, getLanguage, getLifespan, getPlatform, getRange, getStartSnap, getThread, setEndSnap
-
Method Details
-
isDefined
default boolean isDefined()Description copied from interface:DataReturns true if the data type is defined. Any address that has not been defined to be code or data is treated as undefined data. -
doGetComponentCache
AbstractDBTraceDataComponent[] doGetComponentCache()TODO: Document me Note this will always be called with the write lock- Returns:
- the new or existing component cache
-
getNumComponents
default int getNumComponents()Description copied from interface:DataReturn the number of components that make up this data item. if this is an Array, return the number of elements in the array.- Specified by:
getNumComponentsin interfaceData- Returns:
- the number of components
-
getRoot
DBTraceData 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- Returns:
- the data
-
getParent
DBTraceDefinedDataAdapter 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. -
getPathName
-
getComponent
Description copied from interface:DataReturns the immediate n'th component or null if none exists.- Specified by:
getComponentin interfaceData- Specified by:
getComponentin interfaceTraceData- Parameters:
index- the index of the component to get.- Returns:
- the component
-
getComponentAt
Deprecated.Description copied from interface:DataReturn the first immediate child component that contains the byte at the given offset. It is important to note that with certain datatypes there may be more than one component containing the specified offset (seeData.getComponentsContaining(int)).- Specified by:
getComponentAtin interfaceData- Specified by:
getComponentAtin interfaceTraceData- Parameters:
offset- the amount to add to this data items address to get the address of the requested data item.- Returns:
- first data component containing offset or null
-
getComponentContaining
Description copied from interface:DataReturn the first immediate child component that contains the byte at the given offset. It is important to note that with certain datatypes there may be more than one component containing the specified offset (seeData.getComponentsContaining(int)).- Specified by:
getComponentContainingin interfaceData- Specified by:
getComponentContainingin interfaceTraceData- Parameters:
offset- the amount to add to this data items address to get the- Returns:
- first data component containing offset or null address of the requested data item.
-
getComponentsContaining
Description copied from interface:DataReturns a list of all the immediate child components that contain the byte at the given offset.For a union, this will return all the components (if the offset is 0). The presence of bit-fields or zero-length components may cause multiple components to be returned.
- Specified by:
getComponentsContainingin interfaceData- Parameters:
offset- the amount to add to this data items address to get the address of the requested data item.- Returns:
- a list of all the immediate child components that contain the byte at the given offset or null if offset is out of bounds.
-
getPrimitiveAt
Description copied from interface:DataReturns the primitive component containing this offset (i.e., one that does not have sub-components). This is useful for data items which are made up of multiple layers of other data items. This method immediately goes to the lowest level data item. If the minimum offset of a component is specified, the only first component containing the offset will be considered (e.g., 0-element array).- Specified by:
getPrimitiveAtin interfaceData- Specified by:
getPrimitiveAtin interfaceDBTraceDataAdapter- Specified by:
getPrimitiveAtin interfaceTraceData- Parameters:
offset- the offset- Returns:
- primitive component containing this offset
-
doGetComponent
-
getComponent
Get a data item given the index path. Each integer in the array represents an index into the data item at that level. This implementation differs in that the path is relative to this unit, even if it is not the root. InDataDB, it appears the behavior is undefined if you call this on a non-root component.- Specified by:
getComponentin interfaceData- Specified by:
getComponentin interfaceTraceData- Parameters:
componentPath- the array of indexes to use to find the requested data item.- Returns:
- the component
-