Class OperandFieldLocation

    • Constructor Detail

      • OperandFieldLocation

        public OperandFieldLocation​(Program program,
                                    Address addr,
                                    int[] componentPath,
                                    Address refAddr,
                                    java.lang.String rep,
                                    int opIndex,
                                    int characterOffset)
        Construct a new OperandFieldLocation object.
        Parameters:
        program - the program of the location
        addr - address of the location; should not be null
        componentPath - array of indexes for each nested data component; the index is the data component's index within its parent; may be null
        rep - the String representation of the operand.
        opIndex - the index of the operand at this location.
        characterOffset - the character position from the beginning of the operand.
      • OperandFieldLocation

        public OperandFieldLocation​(Program program,
                                    Address addr,
                                    int[] componentPath,
                                    Address refAddr,
                                    java.lang.String rep,
                                    int opIndex,
                                    int subOpIndex,
                                    int characterOffset)
        Construct a new OperandFieldLocation object.
        Parameters:
        program - the program of the location
        addr - address of the location; should not be null
        componentPath - array of indexes for each nested data component; the index is the data component's index within its parent; may be null
        refAddr - the "referred to" address if the location is over a reference; may be null
        rep - the String representation of the operand.
        opIndex - the index indicating the operand the location is on.
        subOpIndex - the index of the Object within the operand, this can be used to call an instructions getOpObjects() method
        characterOffset - the character position from the beginning of the operand field
      • OperandFieldLocation

        public OperandFieldLocation​(Program program,
                                    Address addr,
                                    VariableOffset variableOffset,
                                    Address refAddr,
                                    java.lang.String rep,
                                    int opIndex,
                                    int subOpIndex,
                                    int characterOffset)
        Construct a new OperandFieldLocation object for an instruction operand.
        Parameters:
        program - the program of the location
        addr - address of the location; should not be null
        variableOffset - associated variable offset or null
        refAddr - the "referred to" address if the location is over a reference; may be null
        rep - the String representation of the operand.
        opIndex - the index indicating the operand the location is on.
        subOpIndex - the index of the Object within the operand, this can be used to call an instructions getOpObjects() method
        characterOffset - the character position from the beginning of the operand field
      • OperandFieldLocation

        public OperandFieldLocation()
        Default constructor needed for restoring an operand field location from XML.
    • Method Detail

      • getVariableOffset

        public VariableOffset getVariableOffset()
        Returns VariableOffset object if applicable or null
      • getOperandRepresentation

        public java.lang.String getOperandRepresentation()
        Returns a string representation of the opernand at this location.
      • getOperandIndex

        public int getOperandIndex()
        Returns the index of the operand at this location.
      • getSubOperandIndex

        public int getSubOperandIndex()
        Returns the sub operand index at this location. This index can be used on the instruction.getOpObjects() to find the actual object (Address, Register, Scalar) the cursor is over.
        Returns:
        0-n if over a valid OpObject, -1 otherwise
      • toString

        public java.lang.String toString()
        Returns a String representation of this location.
        Overrides:
        toString in class ProgramLocation
      • saveState

        public void saveState​(SaveState obj)
        Description copied from class: ProgramLocation
        Save this program location to the given save state object.
        Overrides:
        saveState in class ProgramLocation
        Parameters:
        obj - the save state object for saving the location