Interface TraceReference
- All Superinterfaces:
Comparable<Reference>,Reference
- All Known Subinterfaces:
TraceOffsetReference,TraceShiftedReference,TraceStackReference
- All Known Implementing Classes:
DBTraceOffsetReference,DBTraceReference,DBTraceShiftedReference,DBTraceStackReference
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoidClear the associated symboldefault intvoiddelete()Delete this referencedefault SymbolGet the symbol associated with this referenceGet the lifespan for which this reference is effectivelongGet the starting snapshot key of this reference's lifespandefault AddressReturns Get the "to" address for this reference..Get the "to" range of this reference.getTrace()Get the trace containing this referencedefault booleanReturns Returns true if this reference is an instance of EntryReference..default booleanReturns Returns true if this reference is an instance of ExternalReference..default booleanReturns Returns true if this reference to an address in the programs memory space. This includes offset and shifted references..default booleanReturns Return true if this reference is on the Mnemonic and not on an operand..default booleanReturns Returns true if this reference is an instance of OffsetReference..default booleanReturns Return true if this reference is on an operand and not on the Mnemonic..default booleanReturns Returns true if this reference to an address in the programs register space..default booleanReturns Returns true if this reference is an instance of ShiftedReference..default booleanReturns Returns true if this reference is an instance of StackReference and refers to a stack location..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 interface ghidra.program.model.symbol.Reference
getFromAddress, getOperandIndex, getReferenceType, getSource, getSymbolID, isPrimary
-
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
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:
getToAddressin interfaceReference- 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
Set the reference type- Parameters:
refType- the new reference type
-
setAssociatedSymbol
Set the symbol associated with this reference- Parameters:
symbol- the symbol- See Also:
-
clearAssociatedSymbol
void clearAssociatedSymbol()Clear the associated symbol- See Also:
-
getAssociatedSymbol
Get the symbol associated with this reference- Returns:
- the symbol
- See Also:
-
isMnemonicReference
default boolean isMnemonicReference()Description copied from interface:ReferenceReturns Return true if this reference is on the Mnemonic and not on an operand..- Specified by:
isMnemonicReferencein interfaceReference- Returns:
- Return true if this reference is on the Mnemonic and not on an operand.
-
isOperandReference
default boolean isOperandReference()Description copied from interface:ReferenceReturns Return true if this reference is on an operand and not on the Mnemonic..- Specified by:
isOperandReferencein interfaceReference- Returns:
- Return true if this reference is on an operand and not on the Mnemonic.
-
isStackReference
default boolean isStackReference()Description copied from interface:ReferenceReturns Returns true if this reference is an instance of StackReference and refers to a stack location..- Specified by:
isStackReferencein interfaceReference- 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:ReferenceReturns Returns true if this reference is an instance of ExternalReference..- Specified by:
isExternalReferencein interfaceReference- Returns:
- Returns true if this reference is an instance of ExternalReference.
-
isEntryPointReference
default boolean isEntryPointReference()Description copied from interface:ReferenceReturns Returns true if this reference is an instance of EntryReference..- Specified by:
isEntryPointReferencein interfaceReference- Returns:
- Returns true if this reference is an instance of EntryReference.
-
isMemoryReference
default boolean isMemoryReference()Description copied from interface:ReferenceReturns Returns true if this reference to an address in the programs memory space. This includes offset and shifted references..- Specified by:
isMemoryReferencein interfaceReference- 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:ReferenceReturns Returns true if this reference to an address in the programs register space..- Specified by:
isRegisterReferencein interfaceReference- Returns:
- Returns true if this reference to an address in the programs register space.
-
isOffsetReference
default boolean isOffsetReference()Description copied from interface:ReferenceReturns Returns true if this reference is an instance of OffsetReference..- Specified by:
isOffsetReferencein interfaceReference- Returns:
- Returns true if this reference is an instance of OffsetReference.
-
isShiftedReference
default boolean isShiftedReference()Description copied from interface:ReferenceReturns Returns true if this reference is an instance of ShiftedReference..- Specified by:
isShiftedReferencein interfaceReference- Returns:
- Returns true if this reference is an instance of ShiftedReference.
-
compareTo
- Specified by:
compareToin interfaceComparable<Reference>
-
delete
void delete()Delete this reference
-