Class DBTraceReference

java.lang.Object
ghidra.trace.database.symbol.DBTraceReference
All Implemented Interfaces:
Reference, TraceReference, Comparable<Reference>
Direct Known Subclasses:
DBTraceOffsetReference, DBTraceShiftedReference, DBTraceStackReference

public class DBTraceReference extends Object implements TraceReference
  • Field Details

  • Constructor Details

  • Method Details

    • getTrace

      public DBTrace getTrace()
      Description copied from interface: TraceReference
      Get the trace containing this reference
      Specified by:
      getTrace in interface TraceReference
      Returns:
      the trace
    • delete

      public void delete()
      Description copied from interface: TraceReference
      Delete this reference
      Specified by:
      delete in interface TraceReference
    • getLifespan

      public Lifespan getLifespan()
      Description copied from interface: TraceReference
      Get the lifespan for which this reference is effective
      Specified by:
      getLifespan in interface TraceReference
      Returns:
      the lifespan
    • getStartSnap

      public long getStartSnap()
      Description copied from interface: TraceReference
      Get the starting snapshot key of this reference's lifespan
      Specified by:
      getStartSnap in interface TraceReference
      Returns:
      the starting snapshot
      See Also:
    • getFromAddress

      public Address getFromAddress()
      Description copied from interface: Reference
      Returns Get the address of the code unit that is making the reference..
      Specified by:
      getFromAddress in interface Reference
      Returns:
      Get the address of the code unit that is making the reference.
    • getToRange

      public AddressRange getToRange()
      Description copied from interface: TraceReference
      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.

      Specified by:
      getToRange in interface TraceReference
      Returns:
      the to range
    • setPrimary

      public void setPrimary(boolean primary)
      Description copied from interface: TraceReference
      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.
      Specified by:
      setPrimary in interface TraceReference
      Parameters:
      primary -
    • isPrimary

      public boolean isPrimary()
      Description copied from interface: Reference
      Returns Return whether this reference is marked as primary..
      Specified by:
      isPrimary in interface Reference
      Returns:
      Return whether this reference is marked as primary.
    • getSymbolID

      public long getSymbolID()
      Description copied from interface: Reference
      Get the symbol ID associated with this reference. Applies to memory references only.
      Specified by:
      getSymbolID in interface Reference
      Returns:
      symbol ID or -1 if no symbol is associated with this reference
    • getReferenceType

      public RefType getReferenceType()
      Description copied from interface: Reference
      Returns Get the type of reference being made..
      Specified by:
      getReferenceType in interface Reference
      Returns:
      Get the type of reference being made.
    • getOperandIndex

      public int getOperandIndex()
      Description copied from interface: Reference
      Get the operand index of where this reference was placed.
      Specified by:
      getOperandIndex in interface Reference
      Returns:
      op index or ReferenceManager.MNEMONIC
    • getSource

      public SourceType getSource()
      Description copied from interface: Reference
      Gets the source of this reference. SourceTypes
      Specified by:
      getSource in interface Reference
      Returns:
      the source of this reference
    • setReferenceType

      public void setReferenceType(RefType refType)
      Description copied from interface: TraceReference
      Set the reference type
      Specified by:
      setReferenceType in interface TraceReference
      Parameters:
      refType - the new reference type
    • setAssociatedSymbol

      public void setAssociatedSymbol(Symbol symbol)
      Description copied from interface: TraceReference
      Set the symbol associated with this reference
      Specified by:
      setAssociatedSymbol in interface TraceReference
      Parameters:
      symbol - the symbol
      See Also:
    • clearAssociatedSymbol

      public void clearAssociatedSymbol()
      Description copied from interface: TraceReference
      Clear the associated symbol
      Specified by:
      clearAssociatedSymbol in interface TraceReference
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object