Class AbstractPcodeTraceDataAccess
- All Implemented Interfaces:
InternalPcodeTraceDataAccess,PcodeTraceDataAccess
- Direct Known Subclasses:
DefaultPcodeTraceMemoryAccess,DefaultPcodeTraceRegistersAccess
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TraceMemoryManagerprotected final TracePlatformprotected final longprotected final TraceTimeViewport -
Constructor Summary
ConstructorsConstructorDescriptionAbstractPcodeTraceDataAccess(TracePlatform platform, long snap, TraceTimeViewport viewport) Construct a shim -
Method Summary
Modifier and TypeMethodDescriptionintgetBytes(Address start, ByteBuffer buf) Read bytes from the traceGet the language of the associated platformprotected abstract TraceMemoryOperationsgetMemoryOps(boolean createIfAbsent) Get the interface for accessing trace memory or registers<T> PcodeTracePropertyAccess<T> getPropertyAccess(String name, Class<T> type) Get a property-access shim for the named propertylonggetSnap()getViewportState(AddressRange guestRange) Get the composite state of an address range, using the snapshot's viewportintersectUnknown(AddressSetView guestView) Compute the intersection of the given address set and the set ofTraceMemoryState.UNKNOWNmemoryintersectViewKnown(AddressSetView guestView, 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 guestRange, TraceMemoryState state) Set the memory state of an address rangeprotected abstract AddressIf this shim is associated with a (register) overlay space, translate the given address into itprotected abstract AddressRangetoOverlay(AddressRange range) protected abstract AddressSetViewtoOverlay(AddressSetView set) Translate the given emulator address to a host/overlay addressMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.pcode.exec.trace.data.InternalPcodeTraceDataAccess
getPropertyOps
-
Field Details
-
platform
-
snap
protected final long snap -
viewport
-
mm
-
-
Constructor Details
-
AbstractPcodeTraceDataAccess
Construct a shim- Parameters:
platform- the associated platformsnap- the associated snapviewport- the viewport, set to the same snapshot
-
-
Method Details
-
getViewport
- Specified by:
getViewportin interfaceInternalPcodeTraceDataAccess
-
getLanguage
Description copied from interface:PcodeTraceDataAccessGet the language of the associated platform- Specified by:
getLanguagein interfacePcodeTraceDataAccess- Returns:
- the language
-
getPlatform
- Specified by:
getPlatformin interfaceInternalPcodeTraceDataAccess
-
getSnap
public long getSnap()- Specified by:
getSnapin interfaceInternalPcodeTraceDataAccess
-
getMemoryOps
Get the interface for accessing trace memory or registers- Parameters:
createIfAbsent- in the case of registers, whether to create the missing space- Returns:
- the operations, or null
-
toOverlay
If this shim is associated with a (register) overlay space, translate the given address into it- Parameters:
address- the physical (register) address- Returns:
- the overlay address
-
toOverlay
- Parameters:
range- the physical range- Returns:
- the overlay range
- See Also:
-
toOverlay
- Parameters:
set-- Returns:
- See Also:
-
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:
guestRange- 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:
guestRange- 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:
guestView- 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:
guestView- 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
-