Package ghidra.program.model.listing
Class VariableOffset
java.lang.Object
ghidra.program.model.listing.VariableOffset
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
ConstructorDescriptionVariableOffset
(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
Modifier and TypeMethodDescriptionboolean
Returns the data type access portion of this variable offset as a stringGet list of markup objectslong
Returns the Scalar or Register sub-operand replaced by this VariableOffset object.int
hashCode()
boolean
boolean
void
Sets the original replaced sub-operand Register.void
setReplacedElement
(Scalar s, boolean includeScalarAdjustment) Sets the original replaced sub-operand Scalar.toString()
-
Constructor Details
-
VariableOffset
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
-
VariableOffset
Constructor for an explicit variable reference.- Parameters:
ref
- the referencevar
- the variable being referenced
-
-
Method Details
-
setReplacedElement
Sets the original replaced sub-operand Scalar.- Parameters:
s
- scalarincludeScalarAdjustment
- if true scalar adjustment will be included with object list or string representation
-
setReplacedElement
Sets the original replaced sub-operand Register. -
getReplacedElement
Returns the Scalar or Register sub-operand replaced by this VariableOffset object.- Returns:
- object or null
-
toString
-
getDataTypeDisplayText
Returns the data type access portion of this variable offset as a string- Returns:
- the text
-
getObjects
Get list of markup objects- Returns:
- list of markup objects
-
getVariable
-
isIndirect
public boolean isIndirect() -
isDataAccess
public boolean isDataAccess() -
getOffset
public long getOffset() -
hashCode
public int hashCode() -
equals
-