Package ghidra.pcode.emu

# Record Class PcodeEmulationCallbacks.Wrapper<T>

java.lang.Object
java.lang.Record
ghidra.pcode.emu.PcodeEmulationCallbacks.Wrapper<T>

Type Parameters:
  `T` - the emulator's domain
Record Components:
  `thread` - the thread to include in forwarded callbacks
  `cb` - the emulator callbacks to receive forwarded calls

All Implemented Interfaces:
  `PcodeStateCallbacks`

Enclosing interface:
  `PcodeEmulationCallbacks<T>`

public static record PcodeEmulationCallbacks.Wrapper<T>(PcodeThread<T> thread, PcodeEmulationCallbacks<T> cb) extends Record implements PcodeStateCallbacks
A wrapper that can forward callbacks from state pieces to callbacks for the emulator, for a given thread.

- ## Nested Class Summary

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

  `PcodeStateCallbacks.NoPcodeStateCallbacks`

- ## Field Summary

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

  `NONE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Wrapper(PcodeThread<T> thread, PcodeEmulationCallbacks<T> cb)`
  Creates an instance of a `Wrapper` record class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `PcodeEmulationCallbacks<T>`
  `cb()`
  Returns the value of the `cb` record component.
  `<A, U> void`
  `dataWritten(PcodeExecutorStatePiece<A,U> piece, Address address, int length, U value)`
  Data was written into the given state piece (concrete addressing).
  `<A, U> void`
  `dataWritten(PcodeExecutorStatePiece<A,U> piece, AddressSpace space, A offset, int length, U value)`
  Data was written into the given state piece (abstract addressing.)
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `<A, U> AddressSetView`
  `readUninitialized(PcodeExecutorStatePiece<A,U> piece, AddressSetView set)`
  The executor is preparing to read from uninitialized portions of the given state piece (concrete addressing).
  `<A, U> int`
  `readUninitialized(PcodeExecutorStatePiece<A,U> piece, AddressSpace space, A offset, int length)`
  The executor is preparing to read from uninitialized portions of the given state piece (abstract addressing).
  `PcodeThread<T>`
  `thread()`
  Returns the value of the `thread` record component.
  `final String`
  `toString()`
  Returns a string representation of this record class.

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

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

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

  `delegateDataWritten, delegateDataWritten, delegateReadUninitialized, delegateReadUninitialized`

- ## Constructor Details

  - ### Wrapper

    public Wrapper(PcodeThread<T> thread, PcodeEmulationCallbacks<T> cb)
    Creates an instance of a `Wrapper` record class.
    Parameters:
      `thread` - the value for the `thread` record component
      `cb` - the value for the `cb` record component

- ## Method Details

  - ### dataWritten

    public <A, U> void dataWritten(PcodeExecutorStatePiece<A,U> piece, Address address, int length, U value)
    Description copied from interface: `PcodeStateCallbacks`
    Data was written into the given state piece (concrete addressing).
    Specified by:
      `dataWritten` in interface `PcodeStateCallbacks`
    Type Parameters:
      `A` - the piece's address domain
      `U` - the piece's value domain
    Parameters:
      `piece` - the state piece
      `address` - the address of the operand
      `length` - the size of the operand
      `value` - the value written

  - ### dataWritten

    public <A, U> void dataWritten(PcodeExecutorStatePiece<A,U> piece, AddressSpace space, A offset, int length, U value)
    Description copied from interface: `PcodeStateCallbacks`
    Data was written into the given state piece (abstract addressing.)
    Specified by:
      `dataWritten` in interface `PcodeStateCallbacks`
    Type Parameters:
      `A` - the piece's address domain
      `U` - the piece's value domain
    Parameters:
      `piece` - the state piece
      `space` - the address space of the operand
      `offset` - the offset of the operand
      `length` - the size of the operand
      `value` - the value written

  - ### readUninitialized

    public <A, U> int readUninitialized(PcodeExecutorStatePiece<A,U> piece, AddressSpace space, A offset, int length)
    Description copied from interface: `PcodeStateCallbacks`
    The executor is preparing to read from uninitialized portions of the given state piece (abstract addressing).

    This callback provides an opportunity for something to initialize the required portion lazily. In most cases, this should either return 0 indicating the requested portion remains uninitialized, or the full `length` indicating the full requested portion is now initialized. If, for some reason, the requested portion could only be partially initialized, this can return a smaller length. Partial initializations are only recognized from the starting offset. Other parts could be initialized; however, there is no mechanism for communicating that result to the executor.

    Specified by:
      `readUninitialized` in interface `PcodeStateCallbacks`
    Type Parameters:
      `A` - the piece's address domain
      `U` - the piece's value domain
    Parameters:
      `piece` - the state piece
      `space` - the address space of the operand
      `offset` - the offset of the operand
      `length` - the size of the operand
    Returns:
      the length of the operand just initialized, typically 0 or `length`

  - ### readUninitialized

    public <A, U> AddressSetView readUninitialized(PcodeExecutorStatePiece<A,U> piece, AddressSetView set)
    Description copied from interface: `PcodeStateCallbacks`
    The executor is preparing to read from uninitialized portions of the given state piece (concrete addressing).

    This callback provides an opportunity for something to initialize the required portion lazily. This method must return the address set that remains uninitialized. If no part of the required portion was initialized, this should return `set` identically, so that the caller can quickly recognize that nothing has changed. Otherwise, this should copy `set`, remove those parts it was able to initialize, and return the copy. DO NOT modify the given `set`.

    Specified by:
      `readUninitialized` in interface `PcodeStateCallbacks`
    Type Parameters:
      `A` - the piece's address domain
      `U` - the piece's value domain
    Parameters:
      `piece` - the state piece
      `set` - the uninitialized portion required
    Returns:
      the addresses in `set` that remain uninitialized

  - ### toString

    public final String toString()
    Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
    Specified by:
      `toString` in class `Record`
    Returns:
      a string representation of this object

  - ### hashCode

    public final int hashCode()
    Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
    Specified by:
      `hashCode` in class `Record`
    Returns:
      a hash code value for this object

  - ### equals

    public final boolean equals(Object o)
    Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with `Objects::equals(Object,Object)`.
    Specified by:
      `equals` in class `Record`
    Parameters:
      `o` - the object with which to compare
    Returns:
      `true` if this object is the same as the `o` argument; `false` otherwise.

  - ### thread

    public PcodeThread<T> thread()
    Returns the value of the `thread` record component.
    Returns:
      the value of the `thread` record component

  - ### cb

    public PcodeEmulationCallbacks<T> cb()
    Returns the value of the `cb` record component.
    Returns:
      the value of the `cb` record component