Package ghidra.program.model.symbol
Class MemReferenceImpl
java.lang.Object
ghidra.program.model.symbol.MemReferenceImpl
- All Implemented Interfaces:
Reference,Comparable<Reference>
Implementation for a reference, not associated with a program.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected RefTypeprotected SourceTypeprotected long -
Constructor Summary
ConstructorsConstructorDescriptionMemReferenceImpl(Address fromAddr, Address toAddr, RefType refType, SourceType sourceType, int opIndex, boolean isPrimary) Constructs a MemReferenceImpl. -
Method Summary
Modifier and TypeMethodDescriptionintbooleanReturns Get the address of the code unit that is making the reference..intGet 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 symbol ID associated with this reference.Returns Get the "to" address for this reference..booleanReturns Returns true if this reference is an instance of EntryReference..booleanReturns Returns true if this reference is an instance of ExternalReference..booleanReturns Returns true if this reference to an address in the programs memory space. This includes offset and shifted references..booleanReturns Return true if this reference is on the Mnemonic and not on an operand..booleanReturns Returns true if this reference is an instance of OffsetReference..booleanReturns Return true if this reference is on an operand and not on the Mnemonic..booleanReturns Return whether this reference is marked as primary..booleanReturns Returns true if this reference to an address in the programs register space..booleanReturns Returns true if this reference is an instance of ShiftedReference..booleanReturns Returns true if this reference is an instance of StackReference and refers to a stack location..voidsetSource(SourceType source)
-
Field Details
-
refType
-
opIndex
protected int opIndex -
sourceType
-
symbolID
protected long symbolID -
isPrimary
protected boolean isPrimary
-
-
Constructor Details
-
MemReferenceImpl
public MemReferenceImpl(Address fromAddr, Address toAddr, RefType refType, SourceType sourceType, int opIndex, boolean isPrimary) Constructs a MemReferenceImpl.- Parameters:
fromAddr- reference from addresstoAddr- reference to addressrefType- the type of the referencesourceType- reference source typeSourceTypeopIndex- the operand index of the from locationisPrimary- true if this reference should substitue the operand
-
-
Method Details
-
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.
- See Also:
-
getToAddress
Description copied from interface:ReferenceReturns Get the "to" address for this reference..- Specified by:
getToAddressin interfaceReference- Returns:
- Get the "to" address for this reference.
- See Also:
-
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
- See Also:
-
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.
- See Also:
-
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
- See Also:
-
isMnemonicReference
public 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.
- See Also:
-
isOperandReference
public 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.
- See Also:
-
compareTo
- Specified by:
compareToin interfaceComparable<Reference>- See Also:
-
equals
-
isExternalReference
public 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.
- See Also:
-
isOffsetReference
public 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.
- See Also:
-
isShiftedReference
public 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.
- See Also:
-
isEntryPointReference
public 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.
- See Also:
-
isMemoryReference
public 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.
- See Also:
-
isRegisterReference
public 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.
- See Also:
-
isStackReference
public 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.
- See Also:
-
getSource
Description copied from interface:ReferenceGets the source of this reference.SourceTypes -
setSource
-