Package ghidra.pcode.exec.trace.data

# Class AbstractPcodeTraceAccess<S extends PcodeTraceMemoryAccess,L extends PcodeTraceRegistersAccess>

java.lang.Object
ghidra.pcode.exec.trace.data.AbstractPcodeTraceAccess<S,L>

Type Parameters:
  `S` - the type of shared data-access shims provided
  `L` - the type of thread-local data-access shims provided

All Implemented Interfaces:
  `PcodeTraceAccess`

Direct Known Subclasses:
  `DefaultPcodeTraceAccess`

public abstract class AbstractPcodeTraceAccess<S extends PcodeTraceMemoryAccess,L extends PcodeTraceRegistersAccess> extends Object implements PcodeTraceAccess
An abstract implementation of `PcodeTraceAccess`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final Map<org.apache.commons.lang3.tuple.Pair<TraceThread,Integer>,L>`
  `dataForLocalStateByThreadAndFrame`
  `protected S`
  `dataForSharedState`
  `protected final TracePlatform`
  `platform`
  `protected final long`
  `snap`
  `protected final long`
  `threadsSnap`
  `protected final TraceTimeViewport`
  `viewport`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractPcodeTraceAccess(TracePlatform platform, long snap)`
  Construct a shim
  `AbstractPcodeTraceAccess(TracePlatform platform, long snap, long threadsSnap)`
  Construct a shim

- ## Method Summary

  Modifier and Type
  Method
  Description
  `L`
  `getDataForLocalState(PcodeThread<?> thread, int frame)`
  Get the data-access shim for use in an emulator thread's local state
  `L`
  `getDataForLocalState(TraceThread thread, int frame)`
  Get the data-access shim for use in an emulator thread's local state
  `S`
  `getDataForSharedState()`
  Get the data-access shim for use in an emulator's shared state
  `Language`
  `getLanguage()`
  Get the language of the associated platform
  `protected Trace`
  `getTrace()`
  Get the associated trace
  `protected TraceThread`
  `getTraceThread(PcodeThread<?> thread)`
  Get the trace thread conventionally associated with the given p-code thread
  `protected abstract L`
  `newDataForLocalState(TraceThread thread, int frame)`
  Factory method for a thread's local data-access shim
  `protected abstract S`
  `newDataForSharedState()`
  Factory method for the shared data-access shim

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.pcode.exec.trace.data.PcodeTraceAccess

  `deriveForWrite, getDataForThreadState, newPcodeTraceThreadAccess`

- ## Field Details

  - ### platform

    protected final TracePlatform platform

  - ### threadsSnap

    protected final long threadsSnap

  - ### snap

    protected final long snap

  - ### viewport

    protected final TraceTimeViewport viewport

  - ### dataForSharedState

    protected S extends PcodeTraceMemoryAccess dataForSharedState

  - ### dataForLocalStateByThreadAndFrame

    protected final Map<org.apache.commons.lang3.tuple.Pair<TraceThread,Integer>,L extends PcodeTraceRegistersAccess> dataForLocalStateByThreadAndFrame

- ## Constructor Details

  - ### AbstractPcodeTraceAccess

    public AbstractPcodeTraceAccess(TracePlatform platform, long snap, long threadsSnap)
    Construct a shim
    Parameters:
      `platform` - the associated platform
      `snap` - the associated snap
      `threadsSnap` - the snap to use when finding associated threads between trace and emulator

  - ### AbstractPcodeTraceAccess

    public AbstractPcodeTraceAccess(TracePlatform platform, long snap)
    Construct a shim
    Parameters:
      `platform` - the associated platform
      `snap` - the associated snap

- ## Method Details

  - ### getTrace

    protected Trace getTrace()
    Get the associated trace
    Returns:
      the trace

  - ### getTraceThread

    protected TraceThread getTraceThread(PcodeThread<?> thread)
    Get the trace thread conventionally associated with the given p-code thread

    A p-code thread is conventionally associated with the trace thread whose path matches the p-code thread's name.

    Parameters:
      `thread` - the p-code thread
    Returns:
      the trace thread

  - ### getLanguage

    public Language getLanguage()
    Description copied from interface: `PcodeTraceAccess`
    Get the language of the associated platform
    Specified by:
      `getLanguage` in interface `PcodeTraceAccess`
    Returns:
      the langauge

  - ### newDataForSharedState

    protected abstract S newDataForSharedState()
    Factory method for the shared data-access shim
    Returns:
      the new data-access shim

  - ### getDataForSharedState

    public S getDataForSharedState()
    Description copied from interface: `PcodeTraceAccess`
    Get the data-access shim for use in an emulator's shared state
    Specified by:
      `getDataForSharedState` in interface `PcodeTraceAccess`
    Returns:
      the shim

  - ### newDataForLocalState

    protected abstract L newDataForLocalState(TraceThread thread, int frame)
    Factory method for a thread's local data-access shim
    Parameters:
      `thread` - the associated trace thread
      `frame` - the frame, usually 0
    Returns:
      the new data-access shim

  - ### getDataForLocalState

    public L getDataForLocalState(TraceThread thread, int frame)
    Description copied from interface: `PcodeTraceAccess`
    Get the data-access shim for use in an emulator thread's local state
    Specified by:
      `getDataForLocalState` in interface `PcodeTraceAccess`
    Parameters:
      `thread` - the trace thread associated with the emulator's thread
      `frame` - the frame, usually 0
    Returns:
      the shim

  - ### getDataForLocalState

    public L getDataForLocalState(PcodeThread<?> thread, int frame)
    Description copied from interface: `PcodeTraceAccess`
    Get the data-access shim for use in an emulator thread's local state
    Specified by:
      `getDataForLocalState` in interface `PcodeTraceAccess`
    Parameters:
      `thread` - the emulator's thread
      `frame` - the frame, usually 0
    Returns:
      the shim