Class AbstractDBTraceDataComponent
- All Implemented Interfaces:
Settings,CodeUnit,Data,MemBuffer,MemBufferMixin,PropertySet,DBTraceCodeUnitAdapter,DBTraceDataAdapter,DBTraceDefinedDataAdapter,TraceCodeUnit,TraceData,DataAdapterFromDataType,DataAdapterFromSettings,DataAdapterMinimal
- Direct Known Subclasses:
DBTraceDataArrayElementComponent,DBTraceDataCompositeFieldComponent
TraceData for a data component, i.e., field of a struct
or element of an array
These are not backed directly by a table. The root data unit, along with its type, is stored in the table. If the type is composite, then these are generated, possibly recursively, for the components therein.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Addressprotected final DataTypeprotected AbstractDBTraceDataComponent[]protected final DataTypeprotected final Settingsprotected final intprotected final intprotected final intprotected final Addressprotected final DBTraceDefinedDataAdapterprotected int[]protected final DBTraceDataFields 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
ConstructorsConstructorDescriptionAbstractDBTraceDataComponent(DBTraceData root, DBTraceDefinedDataAdapter parent, int index, Address address, DataType dataType, int length) Create a data component -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Delete this code unitTODO: Document me Note this will always be called with the write lockGet the Address which corresponds to the offset 0.If the dataType is a typeDef, then the typeDef's base type is returned, otherwise, the datatType is returned.intgetBytes(ByteBuffer buffer, int addressOffset) Read bytes starting at this unit's address plus the given offset into the given bufferintGet 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.Returns the underlying default settings for these settings or null if there are nonelongGet the end snap of this code unitabstract StringGet the language of this code unitintGet length of this code unit.Get the lifespan of this code unitReturns the ending address for this code unit..Get 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 unitgetRoot()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 adapterlongGet 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 unittoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.program.model.listing.CodeUnit
getComment, getCommentAsArray, setComment, setCommentAsArrayMethods inherited from interface ghidra.program.model.listing.Data
getFieldName, 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, 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
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.docking.settings.Settings
getSuggestedValuesMethods inherited from interface ghidra.trace.model.listing.TraceCodeUnit
getBounds, getRange
-
Field Details
-
root
-
parent
-
index
protected final int index -
address
-
dataType
-
length
protected final int length -
level
protected final int level -
baseDataType
-
maxAddress
-
defaultSettings
-
path
protected int[] path -
componentCache
-
-
Constructor Details
-
AbstractDBTraceDataComponent
public AbstractDBTraceDataComponent(DBTraceData root, DBTraceDefinedDataAdapter parent, int index, Address address, DataType dataType, int length) Create a data component- Parameters:
root- the root data unitparent- the parent component, possibly the rootindex- the index of this component in its parentaddress- the minimum address of this componentdataType- the data type of this componentlength- the length of this component
-
-
Method Details
-
toString
-
delete
public void delete()Description copied from interface:TraceCodeUnitDelete this code unit- Specified by:
deletein interfaceTraceCodeUnit
-
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
-
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
-
getPlatform
Description copied from interface:TraceCodeUnitGet the platform for this unit- Specified by:
getPlatformin interfaceTraceCodeUnit- Returns:
- the platform
-
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
-
getLifespan
Description copied from interface:TraceCodeUnitGet the lifespan of this code unit- Specified by:
getLifespanin interfaceTraceCodeUnit- Returns:
- the lifespan
-
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
-
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. -
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
-
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
-
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
-
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
-
getPathName
Returns the full path name (dot notation) for this field. This includes the symbol name at this address.In other words, this includes the symbol name of the root unit; whereas,
getComponentPathName()omits it.- Specified by:
getPathNamein interfaceData- Returns:
- the path name
-
getComponentPathName
Returns the component path name (dot notation) for this fieldIn other words, this omits the symbol name of the root unit; whereas,
getPathName()includes it.- Specified by:
getComponentPathNamein interfaceData- Returns:
- the component path name
-
getFieldSyntax
-
getPathName
- Specified by:
getPathNamein interfaceDBTraceDefinedDataAdapter
-
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
-
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.
-
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
-