Package ghidra.trace.model.symbol
Interface TraceReferenceOperations
- All Known Subinterfaces:
TraceReferenceManager,TraceReferenceSpace
- All Known Implementing Classes:
DBTraceReferenceManager,DBTraceReferenceSpace
public interface TraceReferenceOperations
The operations for adding and retrieving references
-
Method Summary
Modifier and TypeMethodDescriptionaddMemoryReference(Lifespan lifespan, Address fromAddress, AddressRange toRange, RefType refType, SourceType source, int operandIndex) Add a memory referencedefault TraceReferenceaddMemoryReference(Lifespan lifespan, Address fromAddress, Address toAddress, 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 rangeCollection<? extends TraceReference> 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 indexdefault TraceReferencegetReference(long snap, Address fromAddress, Address toAddress, int operandIndex) Find the reference that matches the given parametersgetReference(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 lifespanCollection<? extends TraceReference> getReferencesFrom(long snap, Address fromAddress) Find all references from the given snapshot and addressCollection<? extends TraceReference> getReferencesFrom(long snap, Address fromAddress, int operandIndex) Find all references from the given snapshot, address, and operand indexCollection<? extends TraceReference> 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 TraceReference> getReferencesTo(long snap, Address toAddress) Get all references whose to address (or range) contains the given snapshot and addressdefault Collection<? extends TraceReference> getReferencesToRange(Lifespan span, AddressRange range) Get all references whose to address range intersects the given lifespan and address rangeCollection<? extends TraceReference> getReferencesToRange(Lifespan span, AddressRange range, Rectangle2DDirection order) Get all references whose to address range intersects the given lifespan and address rangedefault booleanhasFlowReferencesFrom(long snap, Address fromAddress) Check if there exists a flow reference from the given snapshot and addressdefault booleanhasReferencesFrom(long snap, Address fromAddress) Check if there exists a reference from the given snapshot and addressdefault booleanhasReferencesFrom(long snap, Address fromAddress, int operandIndex) Check if there exists a reference from the given snapshot, address, and operanddefault booleanhasReferencesTo(long snap, Address toAddress) Check if there exists a reference to the given snapshot and address
-
Method Details
-
addReference
A (a copy of) the given reference to this manager- Parameters:
reference- the reference to add- Returns:
- the resulting reference
-
addReference
A (a copy of) the given reference to this manager- Parameters:
lifespan- the span of time where this reference appliesreference- the reference- Returns:
- the resulting reference
-
addMemoryReference
TraceReference addMemoryReference(Lifespan lifespan, Address fromAddress, AddressRange toRange, RefType refType, SourceType source, int operandIndex) Add a memory reference- 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
-
addMemoryReference
default TraceReference addMemoryReference(Lifespan lifespan, Address fromAddress, Address toAddress, RefType refType, SourceType source, int operandIndex) Add a memory reference- Parameters:
lifespan- the span of time where this reference appliesfromAddress- the from address of the referencetoAddress- the to address 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
TraceOffsetReference addOffsetReference(Lifespan lifespan, Address fromAddress, Address toAddress, boolean toAddrIsBase, long offset, RefType refType, SourceType source, int operandIndex) Add an offset memory reference- 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
TraceShiftedReference addShiftedReference(Lifespan lifespan, Address fromAddress, Address toAddress, int shift, RefType refType, SourceType source, int operandIndex) Add a shifted memory reference- 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
TraceReference addRegisterReference(Lifespan lifespan, Address fromAddress, Register toRegister, RefType refType, SourceType source, int operandIndex) Add a register reference- 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
TraceReference addStackReference(Lifespan lifespan, Address fromAddress, int toStackOffset, RefType refType, SourceType source, int operandIndex) Add a (static) stack reference- 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
Find the reference that matches the given parametersNOTE: It is not sufficient to intersect the to range. It must exactly match that given.
- 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
-
getReference
default TraceReference getReference(long snap, Address fromAddress, Address toAddress, int operandIndex) Find the reference that matches the given parametersNOTE: It is not sufficient to contain the to address. To to range must be a singleton and exactly match that given. To match a range, see
getReference(long, Address, AddressRange, int)- Parameters:
snap- the snapshot keyfromAddress- the from addresstoAddress- the to addressoperandIndex- the operand index for the "from" end, or -1- Returns:
- the found reference or null
-
getReferencesFrom
Find all references from the given snapshot and address- Parameters:
snap- the snapshot keyfromAddress- the from address- Returns:
- the collection of results
-
getReferencesFrom
Collection<? extends TraceReference> getReferencesFrom(long snap, Address fromAddress, int operandIndex) Find all references from the given snapshot, address, and operand index- Parameters:
snap- the snapshot keyfromAddress- the from addressoperandIndex- the operand index for the "from" end, or -1- Returns:
- the collection of results
-
getReferencesFromRange
Find all references with from addresses contained in the given lifespan and address range- Parameters:
span- the lifespan to examinerange- the range to examine- Returns:
- the collection of results
-
getPrimaryReferenceFrom
Get the primary reference matching from the given snapshot, address, and operand index- Parameters:
snap- the snapshot keyfromAddress- the from addressoperandIndex- the operand index for the "from" end, or -1- Returns:
- the found reference or null
-
getFlowReferencesFrom
Get all flow references from the given snapshot and address- Parameters:
snap- the snapshot keyfromAddress- the from address- Returns:
- the collection of results
-
clearReferencesFrom
Clear 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.
- Parameters:
span- the lifespan to removerange- the range to clear
-
getReferencesTo
Get all references whose to address (or range) contains the given snapshot and address- Parameters:
snap- the snapshot keytoAddress- the to address- Returns:
- the collection of results
-
clearReferencesTo
Clear 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.
- Parameters:
span- the lifespan to removerange- the range of clear
-
getReferencesToRange
Collection<? extends TraceReference> getReferencesToRange(Lifespan span, AddressRange range, Rectangle2DDirection order) Get 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.
- Parameters:
span- the lifespan to examinerange- the range to examineorder- the order of items in the collection.- Returns:
- the collection of results
-
getReferencesToRange
default Collection<? extends TraceReference> getReferencesToRange(Lifespan span, AddressRange range) Get all references whose to address range intersects the given lifespan and address range- Parameters:
span- the lifespan to examinerange- the range to examine- Returns:
- the collection of results
-
hasReferencesFrom
Check if there exists a reference from the given snapshot and address- Parameters:
snap- the snapshot keyfromAddress- the from address- Returns:
- true if one or more references exist
-
hasReferencesFrom
Check if there exists a reference from the given snapshot, address, and operand- Parameters:
snap- the snapshot keyfromAddress- the from addressoperandIndex- the operand index, or -1- Returns:
- true if one or more references exist
-
hasFlowReferencesFrom
Check if there exists a flow reference from the given snapshot and address- Parameters:
snap- the snapshot keyfromAddress- the from address- Returns:
- true if one or more flow references exist
-
hasReferencesTo
Check if there exists a reference to the given snapshot and address- Parameters:
snap- the snapshot keytoAddress- the to address- Returns:
- true if one or more references exists
-
getReferenceSources
Get an address set of all "from" addresses in any reference intersecting the given lifespan- Parameters:
span- the lifespan to examine- Returns:
- a (lazily-computed) address set view of all "from" addresses
-
getReferenceDestinations
Get an address set of all "to" addresses in any reference intersecting the given lifespan- Parameters:
span- the lifespan to examine- Returns:
- a (lazily-computed) address set view of all "to" addresses
-
getReferenceCountFrom
Count the number of references from the given snapshot and address- Parameters:
snap- the snapshot keyfromAddress- the from address- Returns:
- the number of references
-
getReferenceCountTo
Count the number of references to the given snapshot and address- Parameters:
snap- the snapshot keytoAddress- the to address- Returns:
- the number of references
-