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
Modifier and TypeFieldDescriptionprotected boolean
protected int
protected RefType
protected SourceType
protected long
-
Constructor Summary
ConstructorDescriptionMemReferenceImpl
(Address fromAddr, Address toAddr, RefType refType, SourceType sourceType, int opIndex, boolean isPrimary) Constructs a MemReferenceImpl. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
Get the address of the codeunit that is making the reference.int
Get the operand index of where this reference was placed.Get the type of reference being made.Gets the source of this reference.long
Get the symbol ID associated with this reference.Get the "to" address for this reference.boolean
Returns true if this reference is an instance of EntryReference.boolean
Returns true if this reference is an instance of ExternalReference.boolean
Returns true if this reference to an address in the programs memory space.boolean
Return true if this reference is on the Mnemonic and not on an operandboolean
Returns true if this reference is an instance of OffsetReference.boolean
Return true if this reference is on an operand and not on the Mnemonic.boolean
Return whether this reference is marked as primary.boolean
Returns true if this reference to an address in the programs register space.boolean
Returns true if this reference is an instance of ShiftedReference.boolean
Returns true if this reference is an instance of StackReference and refers to a stack location.void
setSource
(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 typeSourceType
opIndex
- the operand index of the from locationisPrimary
- true if this reference should substitue the operand
-
-
Method Details
-
getFromAddress
Description copied from interface:Reference
Get the address of the codeunit that is making the reference.- Specified by:
getFromAddress
in interfaceReference
- See Also:
-
getToAddress
Description copied from interface:Reference
Get the "to" address for this reference.- Specified by:
getToAddress
in interfaceReference
- See Also:
-
isPrimary
public boolean isPrimary()Description copied from interface:Reference
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 interfaceReference
- Returns:
- symbol ID or -1 if no symbol is associated with this reference
- See Also:
-
getReferenceType
Description copied from interface:Reference
Get the type of reference being made.- Specified by:
getReferenceType
in interfaceReference
- See Also:
-
getOperandIndex
public int getOperandIndex()Description copied from interface:Reference
Get the operand index of where this reference was placed.- Specified by:
getOperandIndex
in interfaceReference
- Returns:
- op index or ReferenceManager.MNEMONIC
- See Also:
-
isMnemonicReference
public boolean isMnemonicReference()Description copied from interface:Reference
Return true if this reference is on the Mnemonic and not on an operand- Specified by:
isMnemonicReference
in interfaceReference
- See Also:
-
isOperandReference
public boolean isOperandReference()Description copied from interface:Reference
Return true if this reference is on an operand and not on the Mnemonic.- Specified by:
isOperandReference
in interfaceReference
- See Also:
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Reference>
- See Also:
-
equals
-
isExternalReference
public boolean isExternalReference()Description copied from interface:Reference
Returns true if this reference is an instance of ExternalReference.- Specified by:
isExternalReference
in interfaceReference
- See Also:
-
isOffsetReference
public boolean isOffsetReference()Description copied from interface:Reference
Returns true if this reference is an instance of OffsetReference.- Specified by:
isOffsetReference
in interfaceReference
- See Also:
-
isShiftedReference
public boolean isShiftedReference()Description copied from interface:Reference
Returns true if this reference is an instance of ShiftedReference.- Specified by:
isShiftedReference
in interfaceReference
- See Also:
-
isEntryPointReference
public boolean isEntryPointReference()Description copied from interface:Reference
Returns true if this reference is an instance of EntryReference.- Specified by:
isEntryPointReference
in interfaceReference
- See Also:
-
isMemoryReference
public boolean isMemoryReference()Description copied from interface:Reference
Returns true if this reference to an address in the programs memory space. This includes offset and shifted references.- Specified by:
isMemoryReference
in interfaceReference
- See Also:
-
isRegisterReference
public boolean isRegisterReference()Description copied from interface:Reference
Returns true if this reference to an address in the programs register space.- Specified by:
isRegisterReference
in interfaceReference
- See Also:
-
isStackReference
public boolean isStackReference()Description copied from interface:Reference
Returns true if this reference is an instance of StackReference and refers to a stack location.- Specified by:
isStackReference
in interfaceReference
- See Also:
-
getSource
Description copied from interface:Reference
Gets the source of this reference.SourceType
s -
setSource
-