Package ghidra.pcode.exec.trace.data

# Class DefaultPcodeTraceRegistersAccess

java.lang.Object
ghidra.pcode.exec.trace.data.AbstractPcodeTraceDataAccess
ghidra.pcode.exec.trace.data.DefaultPcodeTraceRegistersAccess

All Implemented Interfaces:
  `InternalPcodeTraceDataAccess`, `PcodeTraceDataAccess`, `PcodeTraceRegistersAccess`

public class DefaultPcodeTraceRegistersAccess extends AbstractPcodeTraceDataAccess implements PcodeTraceRegistersAccess
The default data-access shim for trace registers

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final int`
  `frame`
  `protected TraceMemorySpace`
  `ms`
  `protected final TraceThread`
  `thread`

  ### Fields inherited from class ghidra.pcode.exec.trace.data.AbstractPcodeTraceDataAccess

  `mm, platform, snap, viewport`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `DefaultPcodeTraceRegistersAccess(TracePlatform platform, long snap, TraceThread thread, int frame, TraceTimeViewport viewport)`
  Construct a shim

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected TraceMemorySpace`
  `getMemoryOps(boolean createIfAbsent)`
  Get the interface for accessing trace memory or registers
  `<T> TracePropertyMapSpace<T>`
  `getPropertyOps(String name, Class<T> type, boolean createIfAbsent)`
  `void`
  `initializeThreadContext(PcodeThread<?> thread)`
  Initialize the given p-code thread's context register using register context from the trace at the thread's program counter
  `protected boolean`
  `isRegisterKnown(PcodeThread<?> thread, Register register)`
  Check if a register has a `TraceMemoryState.KNOWN` value for the given thread
  `protected Address`
  `toOverlay(Address address)`
  If this shim is associated with a (register) overlay space, translate the given address into it
  `protected AddressRange`
  `toOverlay(AddressRange range)`
  `protected AddressSetView`
  `toOverlay(AddressSetView set)`

  ### Methods inherited from class ghidra.pcode.exec.trace.data.AbstractPcodeTraceDataAccess

  `getBytes, getLanguage, getPlatform, getPropertyAccess, getSnap, getViewport, getViewportState, intersectUnknown, intersectViewKnown, putBytes, setState, translate`

  ### 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.PcodeTraceDataAccess

  `getBytes, getLanguage, getPropertyAccess, getViewportState, intersectUnknown, intersectViewKnown, putBytes, setState, translate`

- ## Field Details

  - ### thread

    protected final TraceThread thread

  - ### frame

    protected final int frame

  - ### ms

    protected TraceMemorySpace ms

- ## Constructor Details

  - ### DefaultPcodeTraceRegistersAccess

    protected DefaultPcodeTraceRegistersAccess(TracePlatform platform, long snap, TraceThread thread, int frame, TraceTimeViewport viewport)
    Construct a shim
    Parameters:
      `platform` - the associated platform
      `snap` - the associated snap
      `thread` - the associated thread whose registers to access
      `frame` - the associated frame, or 0 if not applicable
      `viewport` - the viewport, set to the same snapshot

- ## Method Details

  - ### getMemoryOps

    protected TraceMemorySpace getMemoryOps(boolean createIfAbsent)
    Description copied from class: `AbstractPcodeTraceDataAccess`
    Get the interface for accessing trace memory or registers
    Specified by:
      `getMemoryOps` in class `AbstractPcodeTraceDataAccess`
    Parameters:
      `createIfAbsent` - in the case of registers, whether to create the missing space
    Returns:
      the operations, or null

  - ### getPropertyOps

    public <T> TracePropertyMapSpace<T> getPropertyOps(String name, Class<T> type, boolean createIfAbsent)
    Specified by:
      `getPropertyOps` in interface `InternalPcodeTraceDataAccess`

  - ### isRegisterKnown

    protected boolean isRegisterKnown(PcodeThread<?> thread, Register register)
    Check if a register has a `TraceMemoryState.KNOWN` value for the given thread
    Parameters:
      `thread` - the thread
      `register` - the register
    Returns:
      true if known

  - ### initializeThreadContext

    public void initializeThreadContext(PcodeThread<?> thread)
    Description copied from interface: `PcodeTraceRegistersAccess`
    Initialize the given p-code thread's context register using register context from the trace at the thread's program counter

    This is called during thread construction, after the program counter is initialized from the same trace thread. This will ensure that the instruction decoder starts in the same mode as the disassembler was for the trace.

    Specified by:
      `initializeThreadContext` in interface `PcodeTraceRegistersAccess`
    Parameters:
      `thread` - the thread to initialize

  - ### toOverlay

    protected Address toOverlay(Address address)
    Description copied from class: `AbstractPcodeTraceDataAccess`
    If this shim is associated with a (register) overlay space, translate the given address into it
    Specified by:
      `toOverlay` in class `AbstractPcodeTraceDataAccess`
    Parameters:
      `address` - the physical (register) address
    Returns:
      the overlay address

  - ### toOverlay

    protected AddressRange toOverlay(AddressRange range)
    Specified by:
      `toOverlay` in class `AbstractPcodeTraceDataAccess`
    Parameters:
      `range` - the physical range
    Returns:
      the overlay range
    See Also:
      - `AbstractPcodeTraceDataAccess.toOverlay(Address)`

  - ### toOverlay

    protected AddressSetView toOverlay(AddressSetView set)
    Specified by:
      `toOverlay` in class `AbstractPcodeTraceDataAccess`
    Parameters:
      `set` -
    Returns:
    See Also:
      - `AbstractPcodeTraceDataAccess.toOverlay(Address)`