Package ghidra.pcode.exec

# Enum Class AddressesReadPcodeArithmetic

java.lang.Object
java.lang.Enum<AddressesReadPcodeArithmetic>
ghidra.pcode.exec.AddressesReadPcodeArithmetic

All Implemented Interfaces:
  `PcodeArithmetic<AddressSetView>`, `Serializable`, `Comparable<AddressesReadPcodeArithmetic>`, `Constable`

public enum AddressesReadPcodeArithmetic extends Enum<AddressesReadPcodeArithmetic> implements PcodeArithmetic<AddressSetView>
An auxilliary arithmetic that reports the union of all addresses read, typically during the evaluation of an expression.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

  ## Nested classes/interfaces inherited from interface ghidra.pcode.exec.PcodeArithmetic

  `PcodeArithmetic.Purpose`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `INSTANCE`
  The singleton instance

- ## Field Summary

  ### Fields inherited from interface ghidra.pcode.exec.PcodeArithmetic

  `SIZEOF_SIZEOF`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AddressSetView`
  `binaryOp(int opcode, int sizeout, int sizein1, AddressSetView in1, int sizein2, AddressSetView in2)`
  Apply a binary operator to the given inputs
  `AddressSetView`
  `fromConst(byte[] value)`
  Convert the given constant concrete value to type `T` having the same size.
  `AddressSetView`
  `fromConst(long value, int size)`
  Convert the given constant concrete value to type `T` having the given size.
  `AddressSetView`
  `fromConst(BigInteger value, int size)`
  Convert the given constant concrete value to type `T` having the given size.
  `AddressSetView`
  `fromConst(BigInteger value, int size, boolean isContextreg)`
  Convert the given constant concrete value to type `T` having the given size.
  `Class<AddressSetView>`
  `getDomain()`
  Get the type of values over which this arithmetic operates.
  `Endian`
  `getEndian()`
  Get the endianness of this arithmetic
  `AddressSetView`
  `modAfterLoad(int sizeinAddress, AddressSpace space, AddressSetView inOffset, int sizeinValue, AddressSetView inValue)`
  Apply any modifications after a value is loaded
  `AddressSetView`
  `modBeforeStore(int sizeinOffset, AddressSpace space, AddressSetView inOffset, int sizeinValue, AddressSetView inValue)`
  Apply any modifications before a value is stored
  `long`
  `sizeOf(AddressSetView value)`
  Get the size in bytes, if possible, of the given abstract value
  `byte[]`
  `toConcrete(AddressSetView value, PcodeArithmetic.Purpose purpose)`
  Convert, if possible, the given abstract value to a concrete byte array
  `AddressSetView`
  `unaryOp(int opcode, int sizeout, int sizein1, AddressSetView in1)`
  Apply a unary operator to the given input
  `static AddressesReadPcodeArithmetic`
  `valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static AddressesReadPcodeArithmetic[]`
  `values()`
  Returns an array containing the constants of this enum class, in the order they are declared.

  ### Methods inherited from class java.lang.Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface ghidra.pcode.exec.PcodeArithmetic

  `binaryOp, fromConst, fromConst, fromConst, fromConst, fromConst, fromConst, fromConst, fromConst, isTrue, modAfterLoad, modBeforeStore, ptrAdd, ptrSub, sizeOfAbstract, toAddress, toBigInteger, toDouble, toFloat, toLong, toRegisterValue, unaryOp`

- ## Enum Constant Details

  - ### INSTANCE

    public static final AddressesReadPcodeArithmetic INSTANCE
    The singleton instance

- ## Method Details

  - ### values

    public static AddressesReadPcodeArithmetic[] values()
    Returns an array containing the constants of this enum class, in the order they are declared.
    Returns:
      an array containing the constants of this enum class, in the order they are declared

  - ### valueOf

    public static AddressesReadPcodeArithmetic valueOf(String name)
    Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum class has no constant with the specified name
      `NullPointerException` - if the argument is null

  - ### getDomain

    public Class<AddressSetView> getDomain()
    Description copied from interface: `PcodeArithmetic`
    Get the type of values over which this arithmetic operates.
    Specified by:
      `getDomain` in interface `PcodeArithmetic<AddressSetView>`
    Returns:
      the domain

  - ### getEndian

    public Endian getEndian()
    Description copied from interface: `PcodeArithmetic`
    Get the endianness of this arithmetic

    Often T is a byte array, or at least represents one abstractly. Ideally, it is an array where each element is an abstraction of a byte. If that is the case, then the arithmetic likely has to interpret those bytes as integral values according to an endianness. This should return that endianness.

    If the abstraction has no notion of endianness, return null. In that case, the both `PcodeArithmetic.fromConst(BigInteger, int, boolean)` and `PcodeArithmetic.fromConst(long, int)` must be overridden. Furthermore, unless `PcodeArithmetic.toConcrete(Object, Purpose)` is guaranteed to throw an exception, then `PcodeArithmetic.toBigInteger(Object, Purpose)` and `PcodeArithmetic.toLong(Object, Purpose)` must also be overridden.

    Specified by:
      `getEndian` in interface `PcodeArithmetic<AddressSetView>`
    Returns:
      the endianness or null

  - ### unaryOp

    public AddressSetView unaryOp(int opcode, int sizeout, int sizein1, AddressSetView in1)
    Description copied from interface: `PcodeArithmetic`
    Apply a unary operator to the given input

    Note the sizes of variables are given, because values don't necessarily have an intrinsic size. For example, a `BigInteger` may have a minimum encoding size, but that does not necessarily reflect the size of the variable from which is was read.

    Specified by:
      `unaryOp` in interface `PcodeArithmetic<AddressSetView>`
    Parameters:
      `opcode` - the p-code opcode
      `sizeout` - the size (in bytes) of the output variable
      `sizein1` - the size (in bytes) of the input variable
      `in1` - the input value
    Returns:
      the output value

  - ### binaryOp

    public AddressSetView binaryOp(int opcode, int sizeout, int sizein1, AddressSetView in1, int sizein2, AddressSetView in2)
    Description copied from interface: `PcodeArithmetic`
    Apply a binary operator to the given inputs

    Note the sizes of variables are given, because values don't necessarily have an intrinsic size. For example, a `BigInteger` may have a minimum encoding size, but that does not necessarily reflect the size of the variable from which is was read.

    Specified by:
      `binaryOp` in interface `PcodeArithmetic<AddressSetView>`
    Parameters:
      `opcode` - the operation's opcode. See `PcodeOp`.
      `sizeout` - the size (in bytes) of the output variable
      `sizein1` - the size (in bytes) of the first (left) input variable
      `in1` - the first (left) input value
      `sizein2` - the size (in bytes) of the second (right) input variable
      `in2` - the second (right) input value
    Returns:
      the output value

  - ### modBeforeStore

    public AddressSetView modBeforeStore(int sizeinOffset, AddressSpace space, AddressSetView inOffset, int sizeinValue, AddressSetView inValue)
    Description copied from interface: `PcodeArithmetic`
    Apply any modifications before a value is stored

    This implements any abstractions associated with `PcodeOp.STORE`. This is called on the offset and the value before the value is actually stored into the state. NOTE: STORE ops always quantize the offset.

    Specified by:
      `modBeforeStore` in interface `PcodeArithmetic<AddressSetView>`
    Parameters:
      `sizeinOffset` - the size (in bytes) of the variable used for indirection
      `space` - the address space
      `inOffset` - the value used as the address (or offset)
      `sizeinValue` - the size (in bytes) of the variable to store and of the output variable
      `inValue` - the value to store
    Returns:
      the modified value to store

  - ### modAfterLoad

    public AddressSetView modAfterLoad(int sizeinAddress, AddressSpace space, AddressSetView inOffset, int sizeinValue, AddressSetView inValue)
    Description copied from interface: `PcodeArithmetic`
    Apply any modifications after a value is loaded

    This implements any abstractions associated with `PcodeOp.LOAD`. This is called on the address/offset and the value after the value is actually loaded from the state. NOTE: LOAD ops always quantize the offset.

    Specified by:
      `modAfterLoad` in interface `PcodeArithmetic<AddressSetView>`
    Parameters:
      `sizeinAddress` - the size (in bytes) of the variable used for indirection
      `space` - the address space
      `inOffset` - the value used as the offset
      `sizeinValue` - the size (in bytes) of the variable loaded and of the output variable
      `inValue` - the value loaded
    Returns:
      the modified value loaded

  - ### fromConst

    public AddressSetView fromConst(byte[] value)
    Description copied from interface: `PcodeArithmetic`
    Convert the given constant concrete value to type `T` having the same size.
    Specified by:
      `fromConst` in interface `PcodeArithmetic<AddressSetView>`
    Parameters:
      `value` - the constant value
    Returns:
      the value as a `T`

  - ### fromConst

    public AddressSetView fromConst(BigInteger value, int size, boolean isContextreg)
    Description copied from interface: `PcodeArithmetic`
    Convert the given constant concrete value to type `T` having the given size.

    Note that the size may not be applicable to `T`. It is given to ensure the value can be held in a variable of that size when passed to downstream operators or stored in the executor state.

    Specified by:
      `fromConst` in interface `PcodeArithmetic<AddressSetView>`
    Parameters:
      `value` - the constant value
      `size` - the size (in bytes) of the variable into which the value is to be stored
      `isContextreg` - true to indicate the value is from the disassembly context register. If `T` represents bytes, and the value is the contextreg, then the bytes are in big endian, no matter the machine language's endianness.
    Returns:
      the value as a `T`

  - ### fromConst

    public AddressSetView fromConst(BigInteger value, int size)
    Description copied from interface: `PcodeArithmetic`
    Convert the given constant concrete value to type `T` having the given size.

    The value is assumed not to be for the disassembly context register.

    Specified by:
      `fromConst` in interface `PcodeArithmetic<AddressSetView>`
    Parameters:
      `value` - the constant value
      `size` - the size (in bytes) of the variable into which the value is to be stored
    Returns:
      the value as a `T`
    See Also:
      - `PcodeArithmetic.fromConst(BigInteger, int, boolean)`

  - ### fromConst

    public AddressSetView fromConst(long value, int size)
    Description copied from interface: `PcodeArithmetic`
    Convert the given constant concrete value to type `T` having the given size.

    Note that the size may not be applicable to `T`. It is given to ensure the value can be held in a variable of that size when passed to downstream operators or stored in the executor state.

    Specified by:
      `fromConst` in interface `PcodeArithmetic<AddressSetView>`
    Parameters:
      `value` - the constant value
      `size` - the size (in bytes) of the variable into which the value is to be stored
    Returns:
      the value as a `T`

  - ### toConcrete

    public byte[] toConcrete(AddressSetView value, PcodeArithmetic.Purpose purpose)
    Description copied from interface: `PcodeArithmetic`
    Convert, if possible, the given abstract value to a concrete byte array
    Specified by:
      `toConcrete` in interface `PcodeArithmetic<AddressSetView>`
    Parameters:
      `value` - the abstract value
      `purpose` - the purpose for which the emulator needs a concrete value
    Returns:
      the array

  - ### sizeOf

    public long sizeOf(AddressSetView value)
    Description copied from interface: `PcodeArithmetic`
    Get the size in bytes, if possible, of the given abstract value

    If the abstract value does not conceptually have a size, throw an exception.

    Specified by:
      `sizeOf` in interface `PcodeArithmetic<AddressSetView>`
    Parameters:
      `value` - the abstract value
    Returns:
      the size in bytes