Class DefaultPcodeTraceThreadAccess
- All Implemented Interfaces:
PcodeTraceDataAccess,PcodeTraceMemoryAccess,PcodeTraceRegistersAccess
This is not designed for use with the emulator, but rather with stand-alone p-code executors, e.g., to evaluate a Sleigh expression. It multiplexes a given memory access shim and another register access shim into a single shim for use in one state piece.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PcodeTraceMemoryAccessprotected final PcodeTraceRegistersAccess -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultPcodeTraceThreadAccess(PcodeTraceMemoryAccess memory, PcodeTraceRegistersAccess registers) Construct a shim -
Method Summary
Modifier and TypeMethodDescriptionintgetBytes(Address start, ByteBuffer buf) Read bytes from the traceGet the language of the associated platform<T> PcodeTracePropertyAccess<T> getPropertyAccess(String name, Class<T> type) Get a property-access shim for the named propertygetViewportState(AddressRange range) Get the composite state of an address range, using the snapshot's viewportvoidinitializeThreadContext(PcodeThread<?> thread) Initialize the given p-code thread's context register using register context from the trace at the thread's program counterCompute the intersection of the given address set and the set ofTraceMemoryState.UNKNOWNmemoryintersectViewKnown(AddressSetView view, boolean useFullSpans) Compute the intersection of the given address set and the set ofTraceMemoryState.KNOWNor (@linkTraceMemoryState.ERRORmemoryintputBytes(Address start, ByteBuffer buf) Write bytes into the tracevoidsetState(AddressRange range, TraceMemoryState state) Set the memory state of an address rangeTranslate the given emulator address to a host/overlay address
-
Field Details
-
memory
-
registers
-
-
Constructor Details
-
DefaultPcodeTraceThreadAccess
protected DefaultPcodeTraceThreadAccess(PcodeTraceMemoryAccess memory, PcodeTraceRegistersAccess registers) Construct a shim- Parameters:
memory- the memory access shimregisters- the regsiter access shim
-
-
Method Details
-
getLanguage
Description copied from interface:PcodeTraceDataAccessGet the language of the associated platform- Specified by:
getLanguagein interfacePcodeTraceDataAccess- Returns:
- the language
-
setState
Description copied from interface:PcodeTraceDataAccessSet the memory state of an address rangeThe state is set only for the destination snapshot. It is not effective for the indefinite future.
- Specified by:
setStatein interfacePcodeTraceDataAccess- Parameters:
range- the rangestate- the desired state
-
getViewportState
Description copied from interface:PcodeTraceDataAccessGet the composite state of an address range, using the snapshot's viewportTypically, the viewport is at most 2 snapshots deep. When reading from a captured snapshot, the viewport includes only the source snapshot. When reading from scratch snapshot (usually generated by emulation), the viewport includes that scratch snapshot and the original source snapshot. The
TraceMemoryState.KNOWNaddress set is the union of known address sets among all snapshots in the viewport. If all addresses in the given range areTraceMemoryState.KNOWN, then the composite state is known. Otherwise, the composite state isTraceMemoryState.UNKNOWN.- Specified by:
getViewportStatein interfacePcodeTraceDataAccess- Parameters:
range- the range to check- Returns:
- the composite state of the range
-
intersectViewKnown
Description copied from interface:PcodeTraceDataAccessCompute the intersection of the given address set and the set ofTraceMemoryState.KNOWNor (@linkTraceMemoryState.ERRORmemory- Specified by:
intersectViewKnownin interfacePcodeTraceDataAccess- Parameters:
view- the address setuseFullSpans- how to treat the viewport; true for ever known, false for known now.- Returns:
- the intersection
-
intersectUnknown
Description copied from interface:PcodeTraceDataAccessCompute the intersection of the given address set and the set ofTraceMemoryState.UNKNOWNmemory- Specified by:
intersectUnknownin interfacePcodeTraceDataAccess- Parameters:
view- the address set- Returns:
- the intersection
-
putBytes
Description copied from interface:PcodeTraceDataAccessWrite bytes into the traceEach written byte is effective for future snapshots up to but excluding the next snapshot where another byte is written at the same address.
- Specified by:
putBytesin interfacePcodeTraceDataAccess- Parameters:
start- the address of the first byte to writebuf- a buffer of bytes to write- Returns:
- the number of bytes written
-
getBytes
Description copied from interface:PcodeTraceDataAccessRead bytes from the trace- Specified by:
getBytesin interfacePcodeTraceDataAccess- Parameters:
start- the address of the first byte to readbuf- a buffer to receive the bytes- Returns:
- the number of bytes read
-
translate
Description copied from interface:PcodeTraceDataAccessTranslate the given emulator address to a host/overlay address- Specified by:
translatein interfacePcodeTraceDataAccess- Parameters:
address- the emulator address- Returns:
- the host/overlay address
-
getPropertyAccess
Description copied from interface:PcodeTraceDataAccessGet a property-access shim for the named property- Specified by:
getPropertyAccessin interfacePcodeTraceDataAccess- Type Parameters:
T- the type of the property's values- Parameters:
name- the name of the propertytype- the class of the property's values- Returns:
- the access shim
-
initializeThreadContext
Description copied from interface:PcodeTraceRegistersAccessInitialize the given p-code thread's context register using register context from the trace at the thread's program counterThis 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:
initializeThreadContextin interfacePcodeTraceRegistersAccess- Parameters:
thread- the thread to initialize
-