Interface TraceEmulationIntegration.Writer
- All Superinterfaces:
PcodeEmulationCallbacks<Object>
- All Known Implementing Classes:
TraceEmulationIntegration.TraceWriter
- Enclosing class:
TraceEmulationIntegration
This implements callbacks for the emulator and provides a method for recording logged writes
after some number of emulation steps. The client must pass this writer in as the callbacks
and then later invoke writeDown(PcodeTraceAccess). This also permits the addition of
state piece handlers via putHandler(PieceHandler), should the emulator be operating
on other value domains.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ghidra.pcode.emu.PcodeEmulationCallbacks
PcodeEmulationCallbacks.NoPcodeEmulationCallbacks, PcodeEmulationCallbacks.Wrapper<T> -
Method Summary
Modifier and TypeMethodDescriptiondefault <T> PcodeEmulationCallbacks<T> Cast this writer to fit the emulator's value domainvoidputHandler(TraceEmulationIntegration.PieceHandler<?, ?> handler) Add or replace a handlervoidwriteDown(long snap) Record state changes into the trace at the given snapshot.voidwriteDown(PcodeTraceAccess into) Record state changes into the trace via the given access shimMethods inherited from interface ghidra.pcode.emu.PcodeEmulationCallbacks
afterBranch, afterExecuteInject, afterExecuteInstruction, afterLoad, afterStepOp, afterStore, beforeDecodeInstruction, beforeExecuteInject, beforeExecuteInstruction, beforeLoad, beforeStepOp, beforeStore, dataWritten, dataWritten, delegateDataWritten, delegateDataWritten, delegateReadUninitialized, delegateReadUninitialized, emulatorCreated, getInject, handleMissingUserop, readUninitialized, readUninitialized, sharedStateCreated, threadCreated, wrapFor
-
Method Details
-
writeDown
Record state changes into the trace via the given access shim- Parameters:
into- the access shim
-
writeDown
void writeDown(long snap) Record state changes into the trace at the given snapshot.The destination trace is the same as from the source access shim.
- Parameters:
snap- the destination snapshot key
-
putHandler
Add or replace a handlerThe handler must identify the address and value domains for which it is applicable. If there is already a handler for the same domains, the old handler is replaced by this one. Otherwise, this handler is added without removing any others. The handler is invoked if and only if the emulator's state contains a piece for the same domains. Otherwise, the handler may be silently ignored.
- Parameters:
handler- the handler
-
callbacks
Cast this writer to fit the emulator's value domainUse this as the callbacks parameter when constructing the trace-integrated emulator. We assert this cast is safe, because none of the callbacks actually depend on the emulator's value domain. Instead, the states are accessed generically and invocations doled out to respective
TraceEmulationIntegration.PieceHandlers based on their applicable domain types.- Type Parameters:
T- the emulator's value domain- Returns:
- this
-