Package ghidra.pcode.exec.trace
Class TraceEmulationIntegration.BytesPieceHandler
java.lang.Object
ghidra.pcode.exec.trace.TraceEmulationIntegration.BytesPieceHandler
- All Implemented Interfaces:
TraceEmulationIntegration.PieceHandler<byte[],byte[]>
- Direct Known Subclasses:
TraceEmulationIntegration.ImmediateBytesPieceHandler
- Enclosing class:
TraceEmulationIntegration
public static class TraceEmulationIntegration.BytesPieceHandler
extends Object
implements TraceEmulationIntegration.PieceHandler<byte[],byte[]>
A handler that implements the lazy-read-writer-later pattern of trace integration for a
concrete emulator's bytes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximum number of bytes to buffer at a timeFields inherited from interface ghidra.pcode.exec.trace.TraceEmulationIntegration.PieceHandler
NONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<byte[]> Get the address domain this can handleClass<byte[]> Get the value domain this can handlereadUninitialized(PcodeTraceDataAccess acc, PcodeThread<?> thread, PcodeExecutorStatePiece<byte[], byte[]> piece, AddressSetView set) An uninitialized portion of a state piece is being read (concrete addressing).voidwriteDown(PcodeTraceDataAccess into, PcodeThread<?> thread, PcodeExecutorStatePiece<byte[], byte[]> piece, AddressSetView written) Serialize a given portion of the state to the trace database.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.pcode.exec.trace.TraceEmulationIntegration.PieceHandler
abstractReadUninit, abstractWritten, dataWritten
-
Field Details
-
CHUNK_SIZE
public static final int CHUNK_SIZEThe maximum number of bytes to buffer at a time- See Also:
-
-
Constructor Details
-
BytesPieceHandler
public BytesPieceHandler()
-
-
Method Details
-
getAddressDomain
Description copied from interface:TraceEmulationIntegration.PieceHandlerGet the address domain this can handle- Specified by:
getAddressDomainin interfaceTraceEmulationIntegration.PieceHandler<byte[],byte[]> - Returns:
- the address domain
-
getValueDomain
Description copied from interface:TraceEmulationIntegration.PieceHandlerGet the value domain this can handle- Specified by:
getValueDomainin interfaceTraceEmulationIntegration.PieceHandler<byte[],byte[]> - Returns:
- the value domain
-
readUninitialized
public AddressSetView readUninitialized(PcodeTraceDataAccess acc, PcodeThread<?> thread, PcodeExecutorStatePiece<byte[], byte[]> piece, AddressSetView set) Description copied from interface:TraceEmulationIntegration.PieceHandlerAn uninitialized portion of a state piece is being read (concrete addressing).- Specified by:
readUninitializedin interfaceTraceEmulationIntegration.PieceHandler<byte[],byte[]> - 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:
-
writeDown
public void writeDown(PcodeTraceDataAccess into, PcodeThread<?> thread, PcodeExecutorStatePiece<byte[], byte[]> piece, AddressSetView written) Description copied from interface:TraceEmulationIntegration.PieceHandlerSerialize 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.- Specified by:
writeDownin interfaceTraceEmulationIntegration.PieceHandler<byte[],byte[]> - 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
-