Package ghidra.pcode.exec.trace
Interface TraceEmulationIntegration.PieceHandler<A,T>
- Type Parameters:
A- the address domain of pieces this can handleT- the value domain of pieces this can handle
- All Known Implementing Classes:
TaintPieceHandler,TraceEmulationIntegration.AbstractPropertyBasedPieceHandler,TraceEmulationIntegration.AbstractSimplePropertyBasedPieceHandler,TraceEmulationIntegration.BytesPieceHandler,TraceEmulationIntegration.ImmediateBytesPieceHandler
- Enclosing class:
TraceEmulationIntegration
public static interface TraceEmulationIntegration.PieceHandler<A,T>
The handler for a specific piece within an emulator's (or executor's) state.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TraceEmulationIntegration.PieceHandler<?, ?> A handler that does nothing -
Method Summary
Modifier and TypeMethodDescriptiondefault intabstractReadUninit(PcodeTraceDataAccess acc, PcodeThread<?> thread, PcodeExecutorStatePiece<A, T> piece, AddressSpace space, A offset, int length) An uninitialized portion of a state piece is being read (abstract addressing).default voidabstractWritten(PcodeTraceDataAccess acc, AddressSet written, PcodeThread<?> thread, PcodeExecutorStatePiece<A, T> piece, AddressSpace space, A offset, int length, T value) Data was written (abstract addressing).default booleandataWritten(PcodeTraceDataAccess acc, AddressSet written, PcodeThread<?> thread, PcodeExecutorStatePiece<A, T> piece, Address address, int length, T value) Data was written (concrete addressing).Get the address domain this can handleGet the value domain this can handlereadUninitialized(PcodeTraceDataAccess acc, PcodeThread<?> thread, PcodeExecutorStatePiece<A, T> piece, AddressSetView set) An uninitialized portion of a state piece is being read (concrete addressing).voidwriteDown(PcodeTraceDataAccess into, PcodeThread<?> thread, PcodeExecutorStatePiece<A, T> piece, AddressSetView written) Serialize a given portion of the state to the trace database.
-
Field Details
-
NONE
A handler that does nothing
-
-
Method Details
-
getAddressDomain
Get the address domain this can handle- Returns:
- the address domain
-
getValueDomain
Get the value domain this can handle- Returns:
- the value domain
-
readUninitialized
AddressSetView readUninitialized(PcodeTraceDataAccess acc, PcodeThread<?> thread, PcodeExecutorStatePiece<A, T> piece, AddressSetView set) An uninitialized portion of a state piece is being read (concrete addressing).- Parameters:
acc- the trace access shim for the relevant state (shared or local)thread- the thread, if applicable. This is null if either the state being accessed is the emulator's shared state, or if the state is bound to a plainPcodeExecutor.piece- the state piece being handledset- the uninitialized portion required- Returns:
- the addresses in
setthat remain uninitialized - See Also:
-
abstractReadUninit
default int abstractReadUninit(PcodeTraceDataAccess acc, PcodeThread<?> thread, PcodeExecutorStatePiece<A, T> piece, AddressSpace space, A offset, int length) An uninitialized portion of a state piece is being read (abstract addressing).- Parameters:
acc- the trace access shim for the relevant state (shared or local)thread- the thread, if applicable. This is null if either the state being accessed is the emulator's shared state, or if the state is bound to a plainPcodeExecutor.piece- the state piece being handledspace- the address spaceoffset- the offset at the start of the uninitialized portionlength- the size in bytes of the uninitialized portion- Returns:
- the number of bytes just initialized, typically 0 or
length - See Also:
-
dataWritten
default boolean dataWritten(PcodeTraceDataAccess acc, AddressSet written, PcodeThread<?> thread, PcodeExecutorStatePiece<A, T> piece, Address address, int length, T value) Data was written (concrete addressing).- Parameters:
acc- the trace access shim for the relevant state (shared or local)written- theTraceEmulationIntegration.Writer's current log of written addresses (mutable). Typically, this is not accessed but rather passed to delegate methods.thread- the thread, if applicable. This is null if either the state being accessed is the emulator's shared state, or if the state is bound to a plainPcodeExecutor.piece- the state piece being handledaddress- the start address of the writelength- the size in bytes of the writevalue- the value written- Returns:
- true to prevent the
TraceEmulationIntegration.Writerfrom updating its log. - See Also:
-
abstractWritten
default void abstractWritten(PcodeTraceDataAccess acc, AddressSet written, PcodeThread<?> thread, PcodeExecutorStatePiece<A, T> piece, AddressSpace space, A offset, int length, T value) Data was written (abstract addressing).- Parameters:
acc- the trace access shim for the relevant state (shared or local)written- theTraceEmulationIntegration.Writer's current log of written addresses (mutable). Typically, this is not accessed but rather passed to delegate methods.thread- the thread, if applicable. This is null if either the state being accessed is the emulator's shared state, or if the state is bound to a plainPcodeExecutor.piece- the state piece being handledspace- the address spaceoffset- the offset of the start of the writelength- the size in bytes of the writevalue- the value written- See Also:
-
writeDown
void writeDown(PcodeTraceDataAccess into, PcodeThread<?> thread, PcodeExecutorStatePiece<A, T> piece, AddressSetView written) Serialize a given portion of the state to the trace database.The "given portion" refers to the address set provided in
written. Pieces may also have state assigned to abstract addresses. In such cases, it is up to the handler to track what has been written.- Parameters:
into- the destination trace accessthread- the thread associated with the piece's statepiece- the source state piecewritten- the portion that is known to have been written
-