Package ghidra.trace.database.symbol
Class DBTraceReference
java.lang.Object
ghidra.trace.database.symbol.DBTraceReference
- All Implemented Interfaces:
Reference,TraceReference,Comparable<Reference>
- Direct Known Subclasses:
DBTraceOffsetReference,DBTraceShiftedReference,DBTraceStackReference
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClear the associated symbolvoiddelete()Delete this referenceReturns Get the address of the code unit that is making the reference..Get the lifespan for which this reference is effectiveintGet the operand index of where this reference was placed.Returns Get the type of reference being made..Gets the source of this reference.longGet the starting snapshot key of this reference's lifespanlongGet the symbol ID associated with this reference.Get the "to" range of this reference.getTrace()Get the trace containing this referenceinthashCode()booleanReturns Return whether this reference is marked as primary..voidsetAssociatedSymbol(Symbol symbol) Set the symbol associated with this referencevoidsetPrimary(boolean primary) Make this reference primary.voidsetReferenceType(RefType refType) Set the reference typeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.trace.model.symbol.TraceReference
compareTo, getAssociatedSymbol, getToAddress, isEntryPointReference, isExternalReference, isMemoryReference, isMnemonicReference, isOffsetReference, isOperandReference, isRegisterReference, isShiftedReference, isStackReference
-
Field Details
-
ent
-
-
Constructor Details
-
DBTraceReference
-
-
Method Details
-
getTrace
Description copied from interface:TraceReferenceGet the trace containing this reference- Specified by:
getTracein interfaceTraceReference- Returns:
- the trace
-
delete
public void delete()Description copied from interface:TraceReferenceDelete this reference- Specified by:
deletein interfaceTraceReference
-
getLifespan
Description copied from interface:TraceReferenceGet the lifespan for which this reference is effective- Specified by:
getLifespanin interfaceTraceReference- Returns:
- the lifespan
-
getStartSnap
public long getStartSnap()Description copied from interface:TraceReferenceGet the starting snapshot key of this reference's lifespan- Specified by:
getStartSnapin interfaceTraceReference- Returns:
- the starting snapshot
- See Also:
-
getFromAddress
Description copied from interface:ReferenceReturns Get the address of the code unit that is making the reference..- Specified by:
getFromAddressin interfaceReference- Returns:
- Get the address of the code unit that is making the reference.
-
getToRange
Description copied from interface:TraceReferenceGet 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:
getToRangein interfaceTraceReference- Returns:
- the to range
-
setPrimary
public void setPrimary(boolean primary) Description copied from interface:TraceReferenceMake 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:
setPrimaryin interfaceTraceReference- Parameters:
primary-
-
isPrimary
public boolean isPrimary()Description copied from interface:ReferenceReturns Return whether this reference is marked as primary.. -
getSymbolID
public long getSymbolID()Description copied from interface:ReferenceGet the symbol ID associated with this reference. Applies to memory references only.- Specified by:
getSymbolIDin interfaceReference- Returns:
- symbol ID or -1 if no symbol is associated with this reference
-
getReferenceType
Description copied from interface:ReferenceReturns Get the type of reference being made..- Specified by:
getReferenceTypein interfaceReference- Returns:
- Get the type of reference being made.
-
getOperandIndex
public int getOperandIndex()Description copied from interface:ReferenceGet the operand index of where this reference was placed.- Specified by:
getOperandIndexin interfaceReference- Returns:
- op index or ReferenceManager.MNEMONIC
-
getSource
Description copied from interface:ReferenceGets the source of this reference.SourceTypes -
setReferenceType
Description copied from interface:TraceReferenceSet the reference type- Specified by:
setReferenceTypein interfaceTraceReference- Parameters:
refType- the new reference type
-
setAssociatedSymbol
Description copied from interface:TraceReferenceSet the symbol associated with this reference- Specified by:
setAssociatedSymbolin interfaceTraceReference- Parameters:
symbol- the symbol- See Also:
-
clearAssociatedSymbol
public void clearAssociatedSymbol()Description copied from interface:TraceReferenceClear the associated symbol- Specified by:
clearAssociatedSymbolin interfaceTraceReference- See Also:
-
hashCode
public int hashCode()
-