Class 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 Detail

      • VariableOffset

        public VariableOffset​(Variable variable,
                              long offset,
                              boolean indirect,
                              boolean dataAccess)
        Constructor for an implied variable reference.
        Parameters:
        variable - function variable
        offset - offset into variable
        indirect - 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

        public VariableOffset​(Reference ref,
                              Variable var)
        Constructor for an explicit variable reference.
        Parameters:
        vref -
    • Method Detail

      • setReplacedElement

        public void setReplacedElement​(Scalar s,
                                       boolean includeScalarAdjustment)
        Sets the original replaced sub-operand Scalar.
        Parameters:
        s - scalar
        includeScalarAdjustment - 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 class java.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 class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object