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 TypeMethodDescriptionintbooleanGet the address of the codeunit that is making the reference.intGet the operand index of where this reference was placed.Get the type of reference being made.Gets the source of this reference.longGet the symbol ID associated with this reference.Get the "to" address for this reference.booleanReturns true if this reference is an instance of EntryReference.booleanReturns true if this reference is an instance of ExternalReference.booleanReturns true if this reference to an address in the programs memory space.booleanReturn true if this reference is on the Mnemonic and not on an operandbooleanReturns true if this reference is an instance of OffsetReference.booleanReturn true if this reference is on an operand and not on the Mnemonic.booleanReturn whether this reference is marked as primary.booleanReturns true if this reference to an address in the programs register space.booleanReturns true if this reference is an instance of ShiftedReference.booleanReturns 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:ReferenceGet the address of the codeunit that is making the reference.- Specified by:
getFromAddressin interfaceReference- See Also:
-
getToAddress
Description copied from interface:ReferenceGet the "to" address for this reference.- Specified by:
getToAddressin interfaceReference- See Also:
-
isPrimary
public boolean isPrimary()Description copied from interface:ReferenceReturn 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:ReferenceGet the type of reference being made.- Specified by:
getReferenceTypein interfaceReference- 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:ReferenceReturn true if this reference is on the Mnemonic and not on an operand- Specified by:
isMnemonicReferencein interfaceReference- See Also:
-
isOperandReference
public boolean isOperandReference()Description copied from interface:ReferenceReturn true if this reference is on an operand and not on the Mnemonic.- Specified by:
isOperandReferencein interfaceReference- See Also:
-
compareTo
- Specified by:
compareToin interfaceComparable<Reference>- See Also:
-
equals
-
isExternalReference
public boolean isExternalReference()Description copied from interface:ReferenceReturns true if this reference is an instance of ExternalReference.- Specified by:
isExternalReferencein interfaceReference- See Also:
-
isOffsetReference
public boolean isOffsetReference()Description copied from interface:ReferenceReturns true if this reference is an instance of OffsetReference.- Specified by:
isOffsetReferencein interfaceReference- See Also:
-
isShiftedReference
public boolean isShiftedReference()Description copied from interface:ReferenceReturns true if this reference is an instance of ShiftedReference.- Specified by:
isShiftedReferencein interfaceReference- See Also:
-
isEntryPointReference
public boolean isEntryPointReference()Description copied from interface:ReferenceReturns true if this reference is an instance of EntryReference.- Specified by:
isEntryPointReferencein interfaceReference- See Also:
-
isMemoryReference
public boolean isMemoryReference()Description copied from interface:ReferenceReturns true if this reference to an address in the programs memory space. This includes offset and shifted references.- Specified by:
isMemoryReferencein interfaceReference- See Also:
-
isRegisterReference
public boolean isRegisterReference()Description copied from interface:ReferenceReturns true if this reference to an address in the programs register space.- Specified by:
isRegisterReferencein interfaceReference- See Also:
-
isStackReference
public boolean isStackReference()Description copied from interface:ReferenceReturns true if this reference is an instance of StackReference and refers to a stack location.- Specified by:
isStackReferencein interfaceReference- See Also:
-
getSource
Description copied from interface:ReferenceGets the source of this reference.SourceTypes -
setSource
-