Package ghidra.pcode.exec.trace.data

# Interface PcodeTraceDataAccess

All Known Subinterfaces:
  `InternalPcodeTraceDataAccess`, `PcodeDebuggerDataAccess`, `PcodeDebuggerMemoryAccess`, `PcodeDebuggerRegistersAccess`, `PcodeTraceMemoryAccess`, `PcodeTraceRegistersAccess`

All Known Implementing Classes:
  `AbstractPcodeTraceDataAccess`, `DefaultPcodeTraceMemoryAccess`, `DefaultPcodeTraceRegistersAccess`, `DefaultPcodeTraceThreadAccess`

public interface PcodeTraceDataAccess
A data-access shim for a trace

See Also:
  - `PcodeTraceAccess`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getBytes(Address start, ByteBuffer buf)`
  Read bytes from the trace
  `Language`
  `getLanguage()`
  Get the language of the associated platform
  `<T> PcodeTracePropertyAccess<T>`
  `getPropertyAccess(String name, Class<T> type)`
  Get a property-access shim for the named property
  `TraceMemoryState`
  `getViewportState(AddressRange range)`
  Get the composite state of an address range, using the snapshot's viewport
  `AddressSetView`
  `intersectUnknown(AddressSetView view)`
  Compute the intersection of the given address set and the set of `TraceMemoryState.UNKNOWN` memory
  `AddressSetView`
  `intersectViewKnown(AddressSetView view, boolean useFullSpans)`
  Compute the intersection of the given address set and the set of `TraceMemoryState.KNOWN` or (@link `TraceMemoryState.ERROR` memory
  `int`
  `putBytes(Address start, ByteBuffer buf)`
  Write bytes into the trace
  `void`
  `setState(AddressRange range, TraceMemoryState state)`
  Set the memory state of an address range
  `Address`
  `translate(Address address)`
  Translate the given emulator address to a host/overlay address

- ## Method Details

  - ### getLanguage

    Language getLanguage()
    Get the language of the associated platform
    Returns:
      the language

  - ### setState

    void setState(AddressRange range, TraceMemoryState state)
    Set the memory state of an address range

    The state is set only for the destination snapshot. It is not effective for the indefinite future.

    Parameters:
      `range` - the range
      `state` - the desired state

  - ### getViewportState

    TraceMemoryState getViewportState(AddressRange range)
    Get the composite state of an address range, using the snapshot's viewport

    Typically, the viewport is at most 2 snapshots deep. When reading from a captured snapshot, the viewport includes only the source snapshot. When reading from scratch snapshot (usually generated by emulation), the viewport includes that scratch snapshot and the original source snapshot. The `TraceMemoryState.KNOWN` address set is the union of known address sets among all snapshots in the viewport. If all addresses in the given range are `TraceMemoryState.KNOWN`, then the composite state is known. Otherwise, the composite state is `TraceMemoryState.UNKNOWN`.

    Parameters:
      `range` - the range to check
    Returns:
      the composite state of the range

  - ### intersectViewKnown

    AddressSetView intersectViewKnown(AddressSetView view, boolean useFullSpans)
    Compute the intersection of the given address set and the set of `TraceMemoryState.KNOWN` or (@link `TraceMemoryState.ERROR` memory
    Parameters:
      `view` - the address set
      `useFullSpans` - how to treat the viewport; true for ever known, false for known now.
    Returns:
      the intersection

  - ### intersectUnknown

    AddressSetView intersectUnknown(AddressSetView view)
    Compute the intersection of the given address set and the set of `TraceMemoryState.UNKNOWN` memory
    Parameters:
      `view` - the address set
    Returns:
      the intersection

  - ### putBytes

    int putBytes(Address start, ByteBuffer buf)
    Write bytes into the trace

    Each written byte is effective for future snapshots up to but excluding the next snapshot where another byte is written at the same address.

    Parameters:
      `start` - the address of the first byte to write
      `buf` - a buffer of bytes to write
    Returns:
      the number of bytes written

  - ### getBytes

    int getBytes(Address start, ByteBuffer buf)
    Read bytes from the trace
    Parameters:
      `start` - the address of the first byte to read
      `buf` - a buffer to receive the bytes
    Returns:
      the number of bytes read

  - ### translate

    Address translate(Address address)
    Translate the given emulator address to a host/overlay address
    Parameters:
      `address` - the emulator address
    Returns:
      the host/overlay address

  - ### getPropertyAccess

    <T> PcodeTracePropertyAccess<T> getPropertyAccess(String name, Class<T> type)
    Get a property-access shim for the named property
    Type Parameters:
      `T` - the type of the property's values
    Parameters:
      `name` - the name of the property
      `type` - the class of the property's values
    Returns:
      the access shim