Interface TraceReferenceOperations

All Known Subinterfaces:
TraceReferenceManager, TraceReferenceSpace
All Known Implementing Classes:
DBTraceReferenceManager, DBTraceReferenceSpace

public interface TraceReferenceOperations
The operations for adding and retrieving references
  • Method Details

    • addReference

      TraceReference addReference(TraceReference reference)
      A (a copy of) the given reference to this manager
      Parameters:
      reference - the reference to add
      Returns:
      the resulting reference
    • addReference

      TraceReference addReference(Lifespan lifespan, Reference reference)
      A (a copy of) the given reference to this manager
      Parameters:
      lifespan - the span of time where this reference applies
      reference - 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 applies
      fromAddress - the from address of the reference
      toRange - the to addresses of the reference
      refType - the type of reference
      source - how this reference was derived
      operandIndex - 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 applies
      fromAddress - the from address of the reference
      toAddress - the to address of the reference
      refType - the type of reference
      source - how this reference was derived
      operandIndex - 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 applies
      fromAddress - the from address of the reference
      toAddress - the to address of the reference
      toAddrIsBase - indicate whether or not toAddress incorporates the offset. False means toAddress=base+offset. True means toAddress=base.
      offset - value added to the base address
      refType - the type of reference
      source - how this reference was derived
      operandIndex - 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 applies
      fromAddress - the from address of the reference
      toAddress - the to address of the reference
      shift - the number of bits to shift left
      refType - the type of reference
      source - how this reference was derived
      operandIndex - 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 applies
      fromAddress - the from address of the reference
      toRegister - the to register of the reference
      refType - the type of reference
      source - how this reference was derived
      operandIndex - 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 applies
      fromAddress - the from address of the reference
      toStackOffset - the to offset of the reference
      refType - the type of reference
      source - how this reference was derived
      operandIndex - the operand index for the "from" end, or -1
      Returns:
      the resulting reference
    • getReference

      TraceReference getReference(long snap, Address fromAddress, AddressRange toRange, int operandIndex)
      Find the reference that matches the given parameters

      NOTE: It is not sufficient to intersect the to range. It must exactly match that given.

      Parameters:
      snap - the snapshot key
      fromAddress - the from address
      toRange - the to address range
      operandIndex - 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 parameters

      NOTE: 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 key
      fromAddress - the from address
      toAddress - the to address
      operandIndex - the operand index for the "from" end, or -1
      Returns:
      the found reference or null
    • getReferencesFrom

      Collection<? extends TraceReference> getReferencesFrom(long snap, Address fromAddress)
      Find all references from the given snapshot and address
      Parameters:
      snap - the snapshot key
      fromAddress - 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 key
      fromAddress - the from address
      operandIndex - the operand index for the "from" end, or -1
      Returns:
      the collection of results
    • getReferencesFromRange

      Collection<? extends TraceReference> getReferencesFromRange(Lifespan span, AddressRange range)
      Find all references with from addresses contained in the given lifespan and address range
      Parameters:
      span - the lifespan to examine
      range - the range to examine
      Returns:
      the collection of results
    • getPrimaryReferenceFrom

      TraceReference getPrimaryReferenceFrom(long snap, Address fromAddress, int operandIndex)
      Get the primary reference matching from the given snapshot, address, and operand index
      Parameters:
      snap - the snapshot key
      fromAddress - the from address
      operandIndex - the operand index for the "from" end, or -1
      Returns:
      the found reference or null
    • getFlowReferencesFrom

      Collection<? extends TraceReference> getFlowReferencesFrom(long snap, Address fromAddress)
      Get all flow references from the given snapshot and address
      Parameters:
      snap - the snapshot key
      fromAddress - the from address
      Returns:
      the collection of results
    • clearReferencesFrom

      void clearReferencesFrom(Lifespan span, AddressRange range)
      Clear all references from the given lifespan and address range

      Any reference intersecting the given "from" parameters will have its lifespan truncated to the start of the given lifespan.

      Parameters:
      span - the lifespan to remove
      range - the range to clear
    • getReferencesTo

      Collection<? extends TraceReference> getReferencesTo(long snap, Address toAddress)
      Get all references whose to address (or range) contains the given snapshot and address
      Parameters:
      snap - the snapshot key
      toAddress - the to address
      Returns:
      the collection of results
    • clearReferencesTo

      void clearReferencesTo(Lifespan span, AddressRange range)
      Clear all references to the given lifespan and address range

      Any reference intersecting the given "to" parameters will have its lifespan truncated to the start of the given lifespan.

      Parameters:
      span - the lifespan to remove
      range - 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 range

      The following iteration orders may be specified for the resulting (lazy) collection:

      "Secondary" sorting is not supported.

      Parameters:
      span - the lifespan to examine
      range - the range to examine
      order - 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 examine
      range - the range to examine
      Returns:
      the collection of results
    • hasReferencesFrom

      default boolean hasReferencesFrom(long snap, Address fromAddress)
      Check if there exists a reference from the given snapshot and address
      Parameters:
      snap - the snapshot key
      fromAddress - the from address
      Returns:
      true if one or more references exist
    • hasReferencesFrom

      default boolean hasReferencesFrom(long snap, Address fromAddress, int operandIndex)
      Check if there exists a reference from the given snapshot, address, and operand
      Parameters:
      snap - the snapshot key
      fromAddress - the from address
      operandIndex - the operand index, or -1
      Returns:
      true if one or more references exist
    • hasFlowReferencesFrom

      default boolean hasFlowReferencesFrom(long snap, Address fromAddress)
      Check if there exists a flow reference from the given snapshot and address
      Parameters:
      snap - the snapshot key
      fromAddress - the from address
      Returns:
      true if one or more flow references exist
    • hasReferencesTo

      default boolean hasReferencesTo(long snap, Address toAddress)
      Check if there exists a reference to the given snapshot and address
      Parameters:
      snap - the snapshot key
      toAddress - the to address
      Returns:
      true if one or more references exists
    • getReferenceSources

      AddressSetView getReferenceSources(Lifespan span)
      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

      AddressSetView getReferenceDestinations(Lifespan span)
      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

      int getReferenceCountFrom(long snap, Address fromAddress)
      Count the number of references from the given snapshot and address
      Parameters:
      snap - the snapshot key
      fromAddress - the from address
      Returns:
      the number of references
    • getReferenceCountTo

      int getReferenceCountTo(long snap, Address toAddress)
      Count the number of references to the given snapshot and address
      Parameters:
      snap - the snapshot key
      toAddress - the to address
      Returns:
      the number of references