Enum Class TraceEmulationIntegration

java.lang.Object
java.lang.Enum<TraceEmulationIntegration>
ghidra.pcode.exec.trace.TraceEmulationIntegration
All Implemented Interfaces:
Serializable, Comparable<TraceEmulationIntegration>, Constable

public enum TraceEmulationIntegration extends Enum<TraceEmulationIntegration>
A collection of static methods for integrating an emulator with a trace.
  • Method Details

    • values

      public static TraceEmulationIntegration[] 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 TraceEmulationIntegration 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
    • bytesDelayedWrite

      public static TraceEmulationIntegration.Writer bytesDelayedWrite(PcodeTraceAccess from)
      Create a writer (callbacks) that lazily loads data from the given access shim.

      Writes are logged, but not written to the trace. Instead, the client should call TraceEmulationIntegration.Writer.writeDown(PcodeTraceAccess) to write the logged changes to another given snapshot. This is used for forking emulation from a chosen snapshot and saving the results into (usually scratch) snapshots. Scripts might also use this pattern to save a series of snapshots resulting from an emulation experiment.

      Parameters:
      from - the access shim for lazy loads
      Returns:
      the writer
    • bytesImmediateWrite

      public static TraceEmulationIntegration.Writer bytesImmediateWrite(PcodeTraceAccess access)
      Create a writer (callbacks) that lazily loads data and immediately writes changes to the given access shim.

      Writes are immediately stored into the trace at the same snapshot as state is sourced.

      Parameters:
      access - the access shim for loads and stores
      Returns:
      the writer
    • bytesImmediateWrite

      public static PcodeStateCallbacks bytesImmediateWrite(PcodeTraceAccess access, TraceThread thread, int frame)
      Create state callbacks that lazily load data and immediately write changes to the given access shim.

      Writes are immediately stored into the trace at the same snapshot as state is sourced.

      Use this instead of bytesImmediateWrite(PcodeTraceAccess) when interfacing directly with a PcodeExecutorState vice a PcodeEmulator.

      Parameters:
      access - the access shim for loads and stores
      thread - the trace thread for register accesses
      frame - the frame for register accesses, usually 0
      Returns:
      the callbacks