Package ghidra.program.model.listing
Class VariableOffset
- java.lang.Object
-
- ghidra.program.model.listing.VariableOffset
-
public class VariableOffset extends java.lang.ObjectVariableOffsetcan be used as an operand or sub-operand representation object. The toString() method should be used to obtain the displayable representation string. This object is intended to correspond to a explicit or implicit register/stack variable reference. If an offset other than 0 is specified, the original Scalar should be specified.
-
-
Constructor Summary
Constructors Constructor Description VariableOffset(Variable variable, long offset, boolean indirect, boolean dataAccess)Constructor for an implied variable reference.VariableOffset(Reference ref, Variable var)Constructor for an explicit variable reference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.util.List<java.lang.Object>getObjects()Get list of markup objectslonggetOffset()java.lang.ObjectgetReplacedElement()Returns the Scalar or Register sub-operand replaced by this VariableOffset object.VariablegetVariable()inthashCode()booleanisDataAccess()booleanisIndirect()voidsetReplacedElement(Register reg)Sets the original replaced sub-operand Register.voidsetReplacedElement(Scalar s, boolean includeScalarAdjustment)Sets the original replaced sub-operand Scalar.java.lang.StringtoString()
-
-
-
Constructor Detail
-
VariableOffset
public VariableOffset(Variable variable, long offset, boolean indirect, boolean dataAccess)
Constructor for an implied variable reference.- Parameters:
variable- function variableoffset- offset into variableindirect- if true and variable data-type is a pointer, the offset is relative to underlying data-type of the pointer-type. This should generally be true for register use which would contain a structure pointer not a structure instance, whereas it would be false for stack-references.dataAccess- true if content of variable is being read and/or written
-
-
Method Detail
-
setReplacedElement
public void setReplacedElement(Scalar s, boolean includeScalarAdjustment)
Sets the original replaced sub-operand Scalar.- Parameters:
s- scalarincludeScalarAdjustment- if true scalar adjustment will be included with object list or string representation
-
setReplacedElement
public void setReplacedElement(Register reg)
Sets the original replaced sub-operand Register.
-
getReplacedElement
public java.lang.Object getReplacedElement()
Returns the Scalar or Register sub-operand replaced by this VariableOffset object.- Returns:
- object or null
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
getObjects
public java.util.List<java.lang.Object> getObjects()
Get list of markup objects- Returns:
- list of markup objects
-
getVariable
public Variable getVariable()
-
isIndirect
public boolean isIndirect()
-
isDataAccess
public boolean isDataAccess()
-
getOffset
public long getOffset()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-