Interface PcodeTraceAccess
- All Known Subinterfaces:
PcodeDebuggerAccess
- All Known Implementing Classes:
AbstractPcodeTraceAccess,DefaultPcodeTraceAccess
This encapsulates the source or destination "coordinates" of a trace to simplify access to that trace by p-code operations. This is also meant to encapsulate certain conventions, e.g., writes are effective from the destination snapshot into the indefinite future, and meant to protect p-code executor/emulator states from future re-factorings of the Trace API.
While, technically anything can be behind the shim, the default implementations are backed by a trace. The shim is associated with a chosen platform and snapshot. All methods are with respect to that platform. In particular the addresses must all be in spaces of the platform's language. Note that the platform may be the trace's host platform.
-
Method Summary
Modifier and TypeMethodDescriptionderiveForWrite(long snap) Derive an access for writing a snapshot, where this access was the emulator's sourcegetDataForLocalState(PcodeThread<?> thread, int frame) Get the data-access shim for use in an emulator thread's local stategetDataForLocalState(TraceThread thread, int frame) Get the data-access shim for use in an emulator thread's local stateGet the data-access shim for use in an emulator's shared statedefault PcodeTraceDataAccessgetDataForThreadState(TraceThread thread, int frame) Get the data-access shim for use in an executor having thread contextGet the language of the associated platformdefault PcodeTraceDataAccessConstruct a new trace thread data-access shim
-
Method Details
-
deriveForWrite
Derive an access for writing a snapshot, where this access was the emulator's source- Parameters:
snap- the destination snapshot key- Returns:
- the derived access shim
-
getLanguage
Language getLanguage()Get the language of the associated platform- Returns:
- the langauge
-
getDataForLocalState
Get the data-access shim for use in an emulator thread's local state- Parameters:
thread- the emulator's threadframe- the frame, usually 0- Returns:
- the shim
-
getDataForLocalState
Get the data-access shim for use in an emulator thread's local state- Parameters:
thread- the trace thread associated with the emulator's threadframe- the frame, usually 0- Returns:
- the shim
-
newPcodeTraceThreadAccess
default PcodeTraceDataAccess newPcodeTraceThreadAccess(PcodeTraceMemoryAccess shared, PcodeTraceRegistersAccess local) Construct a new trace thread data-access shim- Parameters:
shared- the shared (memory) statelocal- the local (register) state- Returns:
- the thread data-access shim
-
getDataForThreadState
Get the data-access shim for use in an executor having thread contextNOTE: Do not use this shim for an emulator thread's local state. Use
getDataForLocalState(PcodeThread, int)instead. This shim is meant for use in stand-alone executors, e.g., for evaluating Sleigh expressions. Most likely, the thread is the active thread in the UI.- Parameters:
thread- the trace thread for context, if applicable, or nullframe- the frame- Returns:
- the shim
-