Package ghidra.program.model.listing
Class VariableOffset
- java.lang.Object
-
- ghidra.program.model.listing.VariableOffset
-
public class VariableOffset extends java.lang.Object
VariableOffset
can 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 boolean
equals(java.lang.Object obj)
java.util.List<java.lang.Object>
getObjects()
Get list of markup objectslong
getOffset()
java.lang.Object
getReplacedElement()
Returns the Scalar or Register sub-operand replaced by this VariableOffset object.Variable
getVariable()
int
hashCode()
boolean
isDataAccess()
boolean
isIndirect()
void
setReplacedElement(Register reg)
Sets the original replaced sub-operand Register.void
setReplacedElement(Scalar s, boolean includeScalarAdjustment)
Sets the original replaced sub-operand Scalar.java.lang.String
toString()
-
-
-
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:
toString
in 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:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-