Interface TraceReference

All Superinterfaces:
Comparable<Reference>, Reference
All Known Subinterfaces:
TraceOffsetReference, TraceShiftedReference, TraceStackReference
All Known Implementing Classes:
DBTraceOffsetReference, DBTraceReference, DBTraceShiftedReference, DBTraceStackReference

public interface TraceReference extends Reference
A Reference within a Trace
  • Method Details

    • getTrace

      Trace getTrace()
      Get the trace containing this reference
      Returns:
      the trace
    • getLifespan

      Lifespan getLifespan()
      Get the lifespan for which this reference is effective
      Returns:
      the lifespan
    • getStartSnap

      long getStartSnap()
      Get the starting snapshot key of this reference's lifespan
      Returns:
      the starting snapshot
      See Also:
    • getToRange

      AddressRange getToRange()
      Get the "to" range of this reference.

      Because references are often used in traces to indicate actual run-time writes, it is not sufficient to examine the code unit at a single "to" address and assume the reference is to the entire unit. For one, the read might be of a specific field in a structure data unit. For two, a read of a large unit may be implemented as a loop of several smaller reads. The trace could (and probably should) record each atomic read. In theory, one could examine the "from" instruction and operand index to derive the length, but that is onerous and not indexed. So instead, we record the exact "to" range in each reference and index it. This allows for easy implementation of, e.g., access breakpoints.

      Returns:
      the to range
    • getToAddress

      default Address getToAddress()
      Returns Get the "to" address for this reference..

      For a trace reference, the "to" part is actually a range. This returns the minimum address of that range.

      Specified by:
      getToAddress in interface Reference
      Returns:
      Get the "to" address for this reference.
      See Also:
    • setPrimary

      void setPrimary(boolean primary)
      Make this reference primary. Only one reference at a given "from" location can be primary. If a primary reference already exists at this location, it will become a secondary reference.
      Parameters:
      primary -
    • setReferenceType

      void setReferenceType(RefType refType)
      Set the reference type
      Parameters:
      refType - the new reference type
    • setAssociatedSymbol

      void setAssociatedSymbol(Symbol symbol)
      Set the symbol associated with this reference
      Parameters:
      symbol - the symbol
      See Also:
    • clearAssociatedSymbol

      void clearAssociatedSymbol()
      Clear the associated symbol
      See Also:
    • getAssociatedSymbol

      default Symbol getAssociatedSymbol()
      Get the symbol associated with this reference
      Returns:
      the symbol
      See Also:
    • isMnemonicReference

      default boolean isMnemonicReference()
      Description copied from interface: Reference
      Returns Return true if this reference is on the Mnemonic and not on an operand..
      Specified by:
      isMnemonicReference in interface Reference
      Returns:
      Return true if this reference is on the Mnemonic and not on an operand.
    • isOperandReference

      default boolean isOperandReference()
      Description copied from interface: Reference
      Returns Return true if this reference is on an operand and not on the Mnemonic..
      Specified by:
      isOperandReference in interface Reference
      Returns:
      Return true if this reference is on an operand and not on the Mnemonic.
    • isStackReference

      default boolean isStackReference()
      Description copied from interface: Reference
      Returns Returns true if this reference is an instance of StackReference and refers to a stack location..
      Specified by:
      isStackReference in interface Reference
      Returns:
      Returns true if this reference is an instance of StackReference and refers to a stack location.
    • isExternalReference

      default boolean isExternalReference()
      Description copied from interface: Reference
      Returns Returns true if this reference is an instance of ExternalReference..
      Specified by:
      isExternalReference in interface Reference
      Returns:
      Returns true if this reference is an instance of ExternalReference.
    • isEntryPointReference

      default boolean isEntryPointReference()
      Description copied from interface: Reference
      Returns Returns true if this reference is an instance of EntryReference..
      Specified by:
      isEntryPointReference in interface Reference
      Returns:
      Returns true if this reference is an instance of EntryReference.
    • isMemoryReference

      default boolean isMemoryReference()
      Description copied from interface: Reference
      Returns Returns true if this reference to an address in the programs memory space. This includes offset and shifted references..
      Specified by:
      isMemoryReference in interface Reference
      Returns:
      Returns true if this reference to an address in the programs memory space. This includes offset and shifted references.
    • isRegisterReference

      default boolean isRegisterReference()
      Description copied from interface: Reference
      Returns Returns true if this reference to an address in the programs register space..
      Specified by:
      isRegisterReference in interface Reference
      Returns:
      Returns true if this reference to an address in the programs register space.
    • isOffsetReference

      default boolean isOffsetReference()
      Description copied from interface: Reference
      Returns Returns true if this reference is an instance of OffsetReference..
      Specified by:
      isOffsetReference in interface Reference
      Returns:
      Returns true if this reference is an instance of OffsetReference.
    • isShiftedReference

      default boolean isShiftedReference()
      Description copied from interface: Reference
      Returns Returns true if this reference is an instance of ShiftedReference..
      Specified by:
      isShiftedReference in interface Reference
      Returns:
      Returns true if this reference is an instance of ShiftedReference.
    • compareTo

      default int compareTo(Reference that)
      Specified by:
      compareTo in interface Comparable<Reference>
    • delete

      void delete()
      Delete this reference