Package ghidra.trace.database.symbol
Class DBTraceReferenceSpace
java.lang.Object
ghidra.trace.database.symbol.DBTraceReferenceSpace
- All Implemented Interfaces:
DBTraceSpaceBased,TraceReferenceOperations,TraceReferenceSpace,TraceSpaceMixin
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA reference entryprotected static classprotected static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Languageprotected final DBHandleprotected final AddressRangeImplprotected final ReadWriteLockprotected final DBTraceReferenceManagerprotected final DBTraceAddressSnapRangePropertyMapSpace<DBTraceReferenceSpace.DBTraceReferenceEntry, DBTraceReferenceSpace.DBTraceReferenceEntry> protected final DBCachedObjectIndex<Long, DBTraceReferenceSpace.DBTraceReferenceEntry> protected final AddressSpaceprotected final DBTraceprotected final DBTraceAddressSnapRangePropertyMapSpace<DBTraceReferenceSpace.DBTraceXRefEntry, DBTraceReferenceSpace.DBTraceXRefEntry> protected final DBCachedObjectIndex<Long, DBTraceReferenceSpace.DBTraceXRefEntry> -
Constructor Summary
ConstructorsConstructorDescriptionDBTraceReferenceSpace(DBTraceReferenceManager manager, DBHandle dbh, AddressSpace space, AbstractDBTraceSpaceBasedManager.DBTraceSpaceEntry ent) -
Method Summary
Modifier and TypeMethodDescriptionaddMemoryReference(Lifespan lifespan, Address fromAddress, AddressRange toRange, RefType refType, SourceType source, int operandIndex) Add a memory referenceaddOffsetReference(Lifespan lifespan, Address fromAddress, Address toAddress, boolean toAddrIsBase, long offset, RefType refType, SourceType source, int operandIndex) Add an offset memory referenceaddReference(Lifespan lifespan, Reference reference) A (a copy of) the given reference to this manageraddReference(TraceReference reference) A (a copy of) the given reference to this manageraddRegisterReference(Lifespan lifespan, Address fromAddress, Register toRegister, RefType refType, SourceType source, int operandIndex) Add a register referenceaddShiftedReference(Lifespan lifespan, Address fromAddress, Address toAddress, int shift, RefType refType, SourceType source, int operandIndex) Add a shifted memory referenceaddStackReference(Lifespan lifespan, Address fromAddress, int toStackOffset, RefType refType, SourceType source, int operandIndex) Add a (static) stack referencevoidclearReferencesFrom(Lifespan span, AddressRange range) Clear all references from the given lifespan and address rangevoidclearReferencesTo(Lifespan span, AddressRange range) Clear all references to the given lifespan and address rangeprotected voidprotected voidprotected voidGet the object's address spaceCollection<? extends DBTraceReference> getFlowReferencesFrom(long snap, Address fromAddress) Get all flow references from the given snapshot and addressgetPrimaryReferenceFrom(long snap, Address fromAddress, int operandIndex) Get the primary reference matching from the given snapshot, address, and operand indexgetReference(long snap, Address fromAddress, AddressRange toRange, int operandIndex) Find the reference that matches the given parametersintgetReferenceCountFrom(long snap, Address fromAddress) Count the number of references from the given snapshot and addressintgetReferenceCountTo(long snap, Address toAddress) Count the number of references to the given snapshot and addressGet an address set of all "to" addresses in any reference intersecting the given lifespanprotected Collection<? extends DBTraceReference> getReferencesBySymbolId(long id) Collection<? extends DBTraceReference> getReferencesFrom(long snap, Address fromAddress) Find all references from the given snapshot and addressCollection<? extends DBTraceReference> getReferencesFrom(long snap, Address fromAddress, int operandIndex) Find all references from the given snapshot, address, and operand indexCollection<? extends DBTraceReference> getReferencesFromRange(Lifespan span, AddressRange range) Find all references with from addresses contained in the given lifespan and address rangegetReferenceSources(Lifespan span) Get an address set of all "from" addresses in any reference intersecting the given lifespanCollection<? extends DBTraceReference> getReferencesTo(long snap, Address toAddress) Get all references whose to address (or range) contains the given snapshot and addressCollection<? extends DBTraceReference> getReferencesToRange(Lifespan span, AddressRange range, Rectangle2DDirection order) Get all references whose to address range intersects the given lifespan and address rangeprotected DBTraceReferencegetTrace()Get the trace containing the objectvoidprotected voidmakeWay(Lifespan span, Address fromAddress, AddressRange toRange, int operandIndex) protected voidtruncateOrDeleteEntry(DBTraceReferenceSpace.DBTraceReferenceEntry ref, long otherStartSnap) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.trace.database.space.DBTraceSpaceBased
assertInSpace, assertInSpace, explainLanguages, isMySpace, toAddress, toOverlayMethods inherited from interface ghidra.trace.model.symbol.TraceReferenceOperations
addMemoryReference, getReference, getReferencesToRange, hasFlowReferencesFrom, hasReferencesFrom, hasReferencesFrom, hasReferencesToMethods inherited from interface ghidra.trace.util.TraceSpaceMixin
getFrameLevel, getThread
-
Field Details
-
manager
-
dbh
-
space
-
lock
-
baseLanguage
-
trace
-
fullSpace
-
referenceMapSpace
protected final DBTraceAddressSnapRangePropertyMapSpace<DBTraceReferenceSpace.DBTraceReferenceEntry,DBTraceReferenceSpace.DBTraceReferenceEntry> referenceMapSpace -
refsBySymbolId
protected final DBCachedObjectIndex<Long,DBTraceReferenceSpace.DBTraceReferenceEntry> refsBySymbolId -
xrefMapSpace
protected final DBTraceAddressSnapRangePropertyMapSpace<DBTraceReferenceSpace.DBTraceXRefEntry,DBTraceReferenceSpace.DBTraceXRefEntry> xrefMapSpace -
xrefsByRefKey
-
-
Constructor Details
-
DBTraceReferenceSpace
public DBTraceReferenceSpace(DBTraceReferenceManager manager, DBHandle dbh, AddressSpace space, AbstractDBTraceSpaceBasedManager.DBTraceSpaceEntry ent) throws VersionException, IOException - Throws:
VersionExceptionIOException
-
-
Method Details
-
doAddXRef
-
doDelXRef
-
doSetXRefLifespan
-
getTrace
Description copied from interface:TraceSpaceMixinGet the trace containing the object- Specified by:
getTracein interfaceTraceSpaceMixin- Returns:
- the trace
-
getAddressSpace
Description copied from interface:TraceSpaceMixinGet the object's address space- Specified by:
getAddressSpacein interfaceTraceReferenceSpace- Specified by:
getAddressSpacein interfaceTraceSpaceMixin- Returns:
- the address space
-
addReference
Description copied from interface:TraceReferenceOperationsA (a copy of) the given reference to this manager- Specified by:
addReferencein interfaceTraceReferenceOperations- Parameters:
reference- the reference to add- Returns:
- the resulting reference
-
addReference
Description copied from interface:TraceReferenceOperationsA (a copy of) the given reference to this manager- Specified by:
addReferencein interfaceTraceReferenceOperations- Parameters:
lifespan- the span of time where this reference appliesreference- the reference- Returns:
- the resulting reference
-
makeWay
-
addMemoryReference
public DBTraceReference addMemoryReference(Lifespan lifespan, Address fromAddress, AddressRange toRange, RefType refType, SourceType source, int operandIndex) Description copied from interface:TraceReferenceOperationsAdd a memory reference- Specified by:
addMemoryReferencein interfaceTraceReferenceOperations- Parameters:
lifespan- the span of time where this reference appliesfromAddress- the from address of the referencetoRange- the to addresses of the referencerefType- the type of referencesource- how this reference was derivedoperandIndex- the operand index for the "from" end, or -1- Returns:
- the resulting reference
-
addOffsetReference
public DBTraceOffsetReference addOffsetReference(Lifespan lifespan, Address fromAddress, Address toAddress, boolean toAddrIsBase, long offset, RefType refType, SourceType source, int operandIndex) Description copied from interface:TraceReferenceOperationsAdd an offset memory reference- Specified by:
addOffsetReferencein interfaceTraceReferenceOperations- Parameters:
lifespan- the span of time where this reference appliesfromAddress- the from address of the referencetoAddress- the to address of the referencetoAddrIsBase- indicate whether or not toAddress incorporates the offset. False means toAddress=base+offset. True means toAddress=base.offset- value added to the base addressrefType- the type of referencesource- how this reference was derivedoperandIndex- the operand index for the "from" end, or -1- Returns:
- the resulting reference
-
addShiftedReference
public DBTraceShiftedReference addShiftedReference(Lifespan lifespan, Address fromAddress, Address toAddress, int shift, RefType refType, SourceType source, int operandIndex) Description copied from interface:TraceReferenceOperationsAdd a shifted memory reference- Specified by:
addShiftedReferencein interfaceTraceReferenceOperations- Parameters:
lifespan- the span of time where this reference appliesfromAddress- the from address of the referencetoAddress- the to address of the referenceshift- the number of bits to shift leftrefType- the type of referencesource- how this reference was derivedoperandIndex- the operand index for the "from" end, or -1- Returns:
- the resulting reference
-
addRegisterReference
public DBTraceReference addRegisterReference(Lifespan lifespan, Address fromAddress, Register toRegister, RefType refType, SourceType source, int operandIndex) Description copied from interface:TraceReferenceOperationsAdd a register reference- Specified by:
addRegisterReferencein interfaceTraceReferenceOperations- Parameters:
lifespan- the span of time where this reference appliesfromAddress- the from address of the referencetoRegister- the to register of the referencerefType- the type of referencesource- how this reference was derivedoperandIndex- the operand index for the "from" end, or -1- Returns:
- the resulting reference
-
addStackReference
public DBTraceReference addStackReference(Lifespan lifespan, Address fromAddress, int toStackOffset, RefType refType, SourceType source, int operandIndex) Description copied from interface:TraceReferenceOperationsAdd a (static) stack reference- Specified by:
addStackReferencein interfaceTraceReferenceOperations- Parameters:
lifespan- the span of time where this reference appliesfromAddress- the from address of the referencetoStackOffset- the to offset of the referencerefType- the type of referencesource- how this reference was derivedoperandIndex- the operand index for the "from" end, or -1- Returns:
- the resulting reference
-
getReference
public DBTraceReference getReference(long snap, Address fromAddress, AddressRange toRange, int operandIndex) Description copied from interface:TraceReferenceOperationsFind the reference that matches the given parametersNOTE: It is not sufficient to intersect the to range. It must exactly match that given.
- Specified by:
getReferencein interfaceTraceReferenceOperations- Parameters:
snap- the snapshot keyfromAddress- the from addresstoRange- the to address rangeoperandIndex- the operand index for the "from" end, or -1- Returns:
- the found reference or null
-
getReferencesFrom
Description copied from interface:TraceReferenceOperationsFind all references from the given snapshot and address- Specified by:
getReferencesFromin interfaceTraceReferenceOperations- Parameters:
snap- the snapshot keyfromAddress- the from address- Returns:
- the collection of results
-
getReferencesFrom
public Collection<? extends DBTraceReference> getReferencesFrom(long snap, Address fromAddress, int operandIndex) Description copied from interface:TraceReferenceOperationsFind all references from the given snapshot, address, and operand index- Specified by:
getReferencesFromin interfaceTraceReferenceOperations- Parameters:
snap- the snapshot keyfromAddress- the from addressoperandIndex- the operand index for the "from" end, or -1- Returns:
- the collection of results
-
getReferencesFromRange
public Collection<? extends DBTraceReference> getReferencesFromRange(Lifespan span, AddressRange range) Description copied from interface:TraceReferenceOperationsFind all references with from addresses contained in the given lifespan and address range- Specified by:
getReferencesFromRangein interfaceTraceReferenceOperations- Parameters:
span- the lifespan to examinerange- the range to examine- Returns:
- the collection of results
-
getPrimaryReferenceFrom
Description copied from interface:TraceReferenceOperationsGet the primary reference matching from the given snapshot, address, and operand index- Specified by:
getPrimaryReferenceFromin interfaceTraceReferenceOperations- Parameters:
snap- the snapshot keyfromAddress- the from addressoperandIndex- the operand index for the "from" end, or -1- Returns:
- the found reference or null
-
getFlowReferencesFrom
Description copied from interface:TraceReferenceOperationsGet all flow references from the given snapshot and address- Specified by:
getFlowReferencesFromin interfaceTraceReferenceOperations- Parameters:
snap- the snapshot keyfromAddress- the from address- Returns:
- the collection of results
-
clearReferencesFrom
Description copied from interface:TraceReferenceOperationsClear all references from the given lifespan and address rangeAny reference intersecting the given "from" parameters will have its lifespan truncated to the start of the given lifespan.
- Specified by:
clearReferencesFromin interfaceTraceReferenceOperations- Parameters:
span- the lifespan to removerange- the range to clear
-
getRefEntryForXRefEntry
protected DBTraceReferenceSpace.DBTraceReferenceEntry getRefEntryForXRefEntry(DBTraceReferenceSpace.DBTraceXRefEntry e) -
getRefForXRefEntry
-
getReferencesTo
Description copied from interface:TraceReferenceOperationsGet all references whose to address (or range) contains the given snapshot and address- Specified by:
getReferencesToin interfaceTraceReferenceOperations- Parameters:
snap- the snapshot keytoAddress- the to address- Returns:
- the collection of results
-
getReferencesToRange
public Collection<? extends DBTraceReference> getReferencesToRange(Lifespan span, AddressRange range, Rectangle2DDirection order) Description copied from interface:TraceReferenceOperationsGet all references whose to address range intersects the given lifespan and address rangeThe following iteration orders may be specified for the resulting (lazy) collection:
null- no particular order. This spares the cost of sorting.Rectangle2DDirection.TOPMOST- most-recent (latest snapshot) first.Rectangle2DDirection.BOTTOMMOST- least-recent (earliest including scratch snapshot first).Rectangle2DDirection.LEFTMOST- smallest address first.Rectangle2DDirection.RIGHTMOST- largest address first.
"Secondary" sorting is not supported.
- Specified by:
getReferencesToRangein interfaceTraceReferenceOperations- Parameters:
span- the lifespan to examinerange- the range to examineorder- the order of items in the collection.- Returns:
- the collection of results
-
truncateOrDeleteEntry
protected void truncateOrDeleteEntry(DBTraceReferenceSpace.DBTraceReferenceEntry ref, long otherStartSnap) -
clearReferencesTo
Description copied from interface:TraceReferenceOperationsClear all references to the given lifespan and address rangeAny reference intersecting the given "to" parameters will have its lifespan truncated to the start of the given lifespan.
- Specified by:
clearReferencesToin interfaceTraceReferenceOperations- Parameters:
span- the lifespan to removerange- the range of clear
-
getReferenceSources
Description copied from interface:TraceReferenceOperationsGet an address set of all "from" addresses in any reference intersecting the given lifespan- Specified by:
getReferenceSourcesin interfaceTraceReferenceOperations- Parameters:
span- the lifespan to examine- Returns:
- a (lazily-computed) address set view of all "from" addresses
-
getReferenceDestinations
Description copied from interface:TraceReferenceOperationsGet an address set of all "to" addresses in any reference intersecting the given lifespan- Specified by:
getReferenceDestinationsin interfaceTraceReferenceOperations- Parameters:
span- the lifespan to examine- Returns:
- a (lazily-computed) address set view of all "to" addresses
-
getReferenceCountFrom
Description copied from interface:TraceReferenceOperationsCount the number of references from the given snapshot and address- Specified by:
getReferenceCountFromin interfaceTraceReferenceOperations- Parameters:
snap- the snapshot keyfromAddress- the from address- Returns:
- the number of references
-
getReferenceCountTo
Description copied from interface:TraceReferenceOperationsCount the number of references to the given snapshot and address- Specified by:
getReferenceCountToin interfaceTraceReferenceOperations- Parameters:
snap- the snapshot keytoAddress- the to address- Returns:
- the number of references
-
getReferencesBySymbolId
-
invalidateCache
public void invalidateCache()- Specified by:
invalidateCachein interfaceDBTraceSpaceBased
-