Class DBTraceMemoryManager
- All Implemented Interfaces:
ErrorHandler,DBTraceManager,InternalTraceMemoryOperations,DBTraceDelegatingManager<DBTraceMemorySpace>,TraceMemoryManager,TraceMemoryOperations
-
Nested Class Summary
Nested classes/interfaces inherited from class ghidra.trace.database.space.AbstractDBTraceSpaceBasedManager
AbstractDBTraceSpaceBasedManager.DBTraceSpaceEntryNested classes/interfaces inherited from interface ghidra.trace.database.space.DBTraceDelegatingManager
DBTraceDelegatingManager.ExcConsumer<T,E extends Throwable>, DBTraceDelegatingManager.ExcFunction<T, R, E extends Throwable>, DBTraceDelegatingManager.ExcPredicate<T, E extends Throwable>, DBTraceDelegatingManager.ExcSupplier<T, E extends Throwable> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected final DBTraceOverlaySpaceAdapterFields inherited from class ghidra.trace.database.space.AbstractDBTraceSpaceBasedManager
baseLanguage, dbh, lock, name, NO_ADDRESS_SPACE, regSpacesByContainer, spaces, spaceStore, spacesView, threadManager, trace -
Constructor Summary
ConstructorsConstructorDescriptionDBTraceMemoryManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, Language baseLanguage, DBTrace trace, DBTraceThreadManager threadManager, DBTraceOverlaySpaceAdapter overlayAdapter) -
Method Summary
Modifier and TypeMethodDescriptionaddRegion(String path, Lifespan lifespan, AddressRange range, Collection<TraceMemoryFlag> flags) Add a new region with the given propertiescreateOverlayAddressSpace(String name, AddressSpace base) Create a new address space with the given name based upon the given spaceprotected DBTraceMemorySpacevoidDelete an overlay address spaceprotected Collection<Map.Entry<TraceAddressSnapRange, TraceMemoryState>> doGetStates(Lifespan span, AddressRange range) findBytes(long snap, AddressRange range, ByteBuffer data, ByteBuffer mask, boolean forward, TaskMonitor monitor) Search the given address range at the given snap for a given byte patterngetAddressesWithState(long snap, Predicate<TraceMemoryState> predicate) Get the addresses having state satisfying the given predicategetAddressesWithState(Lifespan snap, AddressSetView set, Predicate<TraceMemoryState> predicate) Get at least the subset of addresses having state satisfying the given predicategetAddressesWithState(Lifespan lifespan, Predicate<TraceMemoryState> predicate) Get the addresses having state satisfying the given predicate at any time in the specified lifespanCollection<? extends TraceMemoryRegion> Get all the regions in this space or managerintGet the block size used by internal storage.getBufferAt(long snap, Address start, ByteOrder byteOrder) Get a view of a particular snap as a memory bufferintgetBytes(long snap, Address start, ByteBuffer buf) Read the most recent bytes from the given snap and addressgetForSpace(AddressSpace space, boolean createIfAbsent) getLiveRegionByPath(long snap, String path) Get the region with the given path at the given snapgetMemoryRegisterSpace(TraceStackFrame frame, boolean createIfAbsent) Obtain a "memory" space bound to the register address space for a stack framegetMemoryRegisterSpace(TraceThread thread, boolean createIfAbsent) Obtain a "memory" space bound to the register address space for frame 0 of a given threadgetMemoryRegisterSpace(TraceThread thread, int frame, boolean createIfAbsent) Obtain a "memory" space bound to the register address space for a given thread and stack framegetMemorySpace(AddressSpace space, boolean createIfAbsent) Obtain a memory space bound to a particular address spacegetMostRecentStateEntry(long snap, Address address) Get the entry recording the most recent state at the given snap and addressBreak a range of addresses into smaller ranges each mapped to its most recent state at the given timegetOrCreateOverlayAddressSpace(String name, AddressSpace base) Get or create an overlay address spacegetRegionContaining(long snap, Address address) Get the region at the given address and snapgetRegionsAddressSet(long snap) Get the addresses contained by regions at the given snapgetRegionsAddressSetWith(long snap, Predicate<TraceMemoryRegion> predicate) Get the addresses contained by regions at the given snap satisfying the given predicateCollection<? extends TraceMemoryRegion> getRegionsAtSnap(long snap) Collect regions at the given snapCollection<? extends TraceMemoryRegion> getRegionsIntersecting(Lifespan lifespan, AddressRange range) Collect regions intersecting the given lifespan and rangegetSnapOfMostRecentChangeToBlock(long snap, Address address) Find the internal storage block that most-recently defines the value at the given snap and address, and return the block's snap.getSpace()For register mapping conventionsGet the state of memory at a given snap and addressgetStateChanges(long from, long to) Collect all the state changes between two given snapsgetStates(long snap, AddressRange range) Break a range of addresses into smaller ranges each mapped to its state at the given snapintgetViewBytes(long snap, Address start, ByteBuffer buf) Read the most recent bytes from the given snap and address, following schedule forksgetViewMostRecentStateEntry(long snap, Address address) Get the entry recording the most recent state at the given snap and address, following schedule forksgetViewMostRecentStateEntry(long snap, AddressRange range, Predicate<TraceMemoryState> predicate) Get the entry recording the most recent state since the given snap within the given range that satisfies a given predicate, following schedule forksgetViewState(long snap, Address address) Get the state of memory at a given snap and address, following schedule forksvoidpack()Optimize storage spaceintputBytes(long snap, Address start, ByteBuffer buf) Write bytes at the given snap and addressreadLock()voidremoveBytes(long snap, Address start, int len) Remove bytes from the given time and locationvoidsetState(long snap, AddressRange range, TraceMemoryState state) Set the state of memory over a given time and address rangevoidsetState(long snap, Address start, Address end, TraceMemoryState state) voidsetState(long snap, Address address, TraceMemoryState state) voidsetState(long snap, AddressSetView set, TraceMemoryState state) Set the state of memory over a given time and address setMethods inherited from class ghidra.trace.database.space.AbstractDBTraceSpaceBasedManager
dbError, get, getActiveSpaces, getBaseLanguage, getForRegisterSpace, getForRegisterSpace, getForRegisterSpace, getLock, getSpaceByName, getTabledSpaces, getTrace, invalidateCache, loadSpaces, tableNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.trace.database.space.DBTraceDelegatingManager
checkIsInMemory, delegateAddressSet, delegateAny, delegateCollection, delegateDeleteB, delegateDeleteV, delegateFirst, delegateHashSet, delegateRead, delegateRead, delegateReadB, delegateReadI, delegateReadI, delegateReadOr, delegateWrite, delegateWriteAll, delegateWriteI, delegateWriteVMethods inherited from interface ghidra.trace.database.memory.InternalTraceMemoryOperations
getBytes, getLock, getState, getStates, getValue, getViewValue, putBytes, removeValue, setState, setValueMethods inherited from interface ghidra.trace.model.memory.TraceMemoryManager
addRegion, createRegion, createRegionMethods inherited from interface ghidra.trace.model.memory.TraceMemoryOperations
getAddressesWithState, getBufferAt, getBytes, getMostRecentStates, getState, getStates, getTrace, getValue, getViewValue, isKnown, putBytes, removeValue, setState, setValue
-
Field Details
-
NAME
- See Also:
-
overlayAdapter
-
-
Constructor Details
-
DBTraceMemoryManager
public DBTraceMemoryManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, Language baseLanguage, DBTrace trace, DBTraceThreadManager threadManager, DBTraceOverlaySpaceAdapter overlayAdapter) throws IOException, VersionException - Throws:
IOExceptionVersionException
-
-
Method Details
-
getSpace
Description copied from interface:InternalTraceMemoryOperationsFor register mapping conventions- Specified by:
getSpacein interfaceInternalTraceMemoryOperations- Returns:
- the address space
-
createOverlayAddressSpace
public AddressSpace createOverlayAddressSpace(String name, AddressSpace base) throws DuplicateNameException Description copied from interface:TraceMemoryManagerCreate a new address space with the given name based upon the given spaceThe purpose of overlay spaces in traces is often to store bytes for things other than memory or registers. Some targets may expose other byte-based storage, or provide alternative views of memory.
NOTE: This also provides a transitional piece for recording a model (sub)tree directly into a trace, without mapping to a Ghidra language first. As we experiment with that mode, we will likely instantiate traces with the "DATA:BE:64:default" language and generate an overlay space named after the path of each memory being recorded. Of course, the mapping still needs to occur between the trace and parts of the display and during emulation.
NOTE: We are also moving away from (space, thread, frame) triples to uniquely identify register storage. Instead, that will be encoded into the address space itself. Register overlays will overlay register space and be named after the register container object, which subsumes thread and frame when applicable.
- Specified by:
createOverlayAddressSpacein interfaceTraceMemoryManager- Parameters:
name- the name of the new address spacebase- the space after which this is modeled- Returns:
- the create space
- Throws:
DuplicateNameException- if an address space with the name already exists
-
getOrCreateOverlayAddressSpace
Description copied from interface:TraceMemoryManagerGet or create an overlay address spaceIf the space already exists, and it overlays the given base, the existing space is returned. If it overlays a different space, null is returned. If the space does not exist, it is created with the given base space.
- Specified by:
getOrCreateOverlayAddressSpacein interfaceTraceMemoryManager- Parameters:
name- the name of the address spacebase- the expected base space- Returns:
- the space, or null
- See Also:
-
deleteOverlayAddressSpace
Description copied from interface:TraceMemoryManagerDelete an overlay address spaceTODO: At the moment, this will not destroy manager spaces created for the deleted address space. We should assess this behavior, esp. wrt. re-creating the address space later, and decide whether or not to clean up.
- Specified by:
deleteOverlayAddressSpacein interfaceTraceMemoryManager- Parameters:
name- the name of the address space to delete
-
createSpace
protected DBTraceMemorySpace createSpace(AddressSpace space, AbstractDBTraceSpaceBasedManager.DBTraceSpaceEntry ent) throws VersionException, IOException - Specified by:
createSpacein classAbstractDBTraceSpaceBasedManager<DBTraceMemorySpace>- Throws:
VersionExceptionIOException
-
getForSpace
- Specified by:
getForSpacein interfaceDBTraceDelegatingManager<DBTraceMemorySpace>- Overrides:
getForSpacein classAbstractDBTraceSpaceBasedManager<DBTraceMemorySpace>
-
readLock
- Specified by:
readLockin interfaceDBTraceDelegatingManager<DBTraceMemorySpace>
-
writeLock
- Specified by:
writeLockin interfaceDBTraceDelegatingManager<DBTraceMemorySpace>
-
getMemorySpace
Description copied from interface:TraceMemoryManagerObtain a memory space bound to a particular address space- Specified by:
getMemorySpacein interfaceTraceMemoryManager- Parameters:
space- the address spacecreateIfAbsent- true to create the space if it's not already present- Returns:
- the space, or
nullif absent and not created
-
getMemoryRegisterSpace
Description copied from interface:TraceMemoryManagerObtain a "memory" space bound to the register address space for frame 0 of a given thread- Specified by:
getMemoryRegisterSpacein interfaceTraceMemoryManager- Parameters:
thread- the given threadcreateIfAbsent- true to create the space if it's not already present- Returns:
- the space, or
nullif absent and not created - See Also:
-
getMemoryRegisterSpace
public DBTraceMemorySpace getMemoryRegisterSpace(TraceThread thread, int frame, boolean createIfAbsent) Description copied from interface:TraceMemoryManagerObtain a "memory" space bound to the register address space for a given thread and stack frame- Specified by:
getMemoryRegisterSpacein interfaceTraceMemoryManager- Parameters:
thread- the given threadframe- the "level" of the given stack frame. 0 is the innermost frame.createIfAbsent- true to create the space if it's not already present- Returns:
- the space, or
nullif absent and not created
-
getMemoryRegisterSpace
Description copied from interface:TraceMemoryManagerObtain a "memory" space bound to the register address space for a stack frameNote this is simply a convenience, and does not in any way bind the space to the lifespan of the given frame. Nor, if the frame is moved, will this space move with it.
- Specified by:
getMemoryRegisterSpacein interfaceTraceMemoryManager- Parameters:
frame- the stack framecreateIfAbsent- true to create the space if it's not already present- Returns:
- the space, or
nullif absent and not created - See Also:
-
addRegion
public TraceMemoryRegion addRegion(String path, Lifespan lifespan, AddressRange range, Collection<TraceMemoryFlag> flags) throws TraceOverlappedRegionException Description copied from interface:TraceMemoryManagerAdd a new region with the given propertiesRegions model the memory mappings of a debugging target. As such, they are never allowed to overlap. Additionally, to ensure
TraceMemoryManager.getLiveRegionByPath(long, String)returns a unique region, duplicate paths cannot exist in the same snap.Regions have a "full name" (path) as well as a short name. The path is immutable and can be used to reliably retrieve the same region later. The short name should be something suitable for display on the screen. Short names are mutable and can be -- but probbaly shouldn't be -- duplicated.
- Specified by:
addRegionin interfaceTraceMemoryManager- Parameters:
path- the "full name" of the regionlifespan- the lifespan of the regionrange- the address range of the regionflags- the flags, e.g., permissions, of the region- Returns:
- the newly-added region
- Throws:
TraceOverlappedRegionException- if the specified region would overlap an existing one
-
getAllRegions
Description copied from interface:TraceMemoryManagerGet all the regions in this space or manager- Specified by:
getAllRegionsin interfaceTraceMemoryManager- Returns:
- the collection of all regions
-
getLiveRegionByPath
Description copied from interface:TraceMemoryManagerGet the region with the given path at the given snap- Specified by:
getLiveRegionByPathin interfaceTraceMemoryManager- Parameters:
snap- the snap which must be within the region's lifespanpath- the "full name" of the region- Returns:
- the region, or
nullif no region matches
-
getRegionContaining
Description copied from interface:TraceMemoryManagerGet the region at the given address and snap- Specified by:
getRegionContainingin interfaceTraceMemoryManager- Parameters:
snap- the snap which must be within the region's lifespanaddress- the address which must be within the region's range- Returns:
- the region, or
nullif no region matches
-
getRegionsIntersecting
public Collection<? extends TraceMemoryRegion> getRegionsIntersecting(Lifespan lifespan, AddressRange range) Description copied from interface:TraceMemoryManagerCollect regions intersecting the given lifespan and range- Specified by:
getRegionsIntersectingin interfaceTraceMemoryManager- Parameters:
lifespan- the lifespanrange- the range- Returns:
- the collection of matching regions
-
getRegionsAtSnap
Description copied from interface:TraceMemoryManagerCollect regions at the given snap- Specified by:
getRegionsAtSnapin interfaceTraceMemoryManager- Parameters:
snap- the snap which must be within the regions' lifespans- Returns:
- the collection of matching regions
-
getRegionsAddressSet
Description copied from interface:TraceMemoryManagerGet the addresses contained by regions at the given snapThe implementation may provide a view that updates with changes.
- Specified by:
getRegionsAddressSetin interfaceTraceMemoryManager- Parameters:
snap- the snap which must be within the regions' lifespans- Returns:
- the union of ranges of matching regions
-
getRegionsAddressSetWith
Description copied from interface:TraceMemoryManagerGet the addresses contained by regions at the given snap satisfying the given predicateThe implementation may provide a view that updates with changes.
- Specified by:
getRegionsAddressSetWithin interfaceTraceMemoryManager- Parameters:
snap- the snap which must be within the region's lifespanspredicate- a predicate on regions to search for- Returns:
- the address set
-
setState
- Specified by:
setStatein interfaceTraceMemoryOperations- See Also:
-
setState
- Specified by:
setStatein interfaceTraceMemoryOperations- See Also:
-
setState
Description copied from interface:TraceMemoryOperationsSet the state of memory over a given time and address rangeSetting state to
TraceMemoryState.KNOWNvia this method is not recommended. Setting bytes will automatically update the state accordingly.- Specified by:
setStatein interfaceTraceMemoryOperations- Parameters:
snap- the timerange- the rangestate- the state
-
setState
Description copied from interface:TraceMemoryOperationsSet the state of memory over a given time and address set- Specified by:
setStatein interfaceTraceMemoryOperations- See Also:
-
getState
Description copied from interface:TraceMemoryOperationsGet the state of memory at a given snap and addressIf the location's state has not been set, the result is
null, which impliesTraceMemoryState.UNKNOWN.- Specified by:
getStatein interfaceTraceMemoryOperations- Parameters:
snap- the timeaddress- the location- Returns:
- the state
-
getViewState
Description copied from interface:TraceMemoryOperationsGet the state of memory at a given snap and address, following schedule forks- Specified by:
getViewStatein interfaceTraceMemoryOperations- Parameters:
snap- the timeaddress- the location- Returns:
- the state, and the snap where it was found
-
getMostRecentStateEntry
public Map.Entry<TraceAddressSnapRange,TraceMemoryState> getMostRecentStateEntry(long snap, Address address) Description copied from interface:TraceMemoryOperationsGet the entry recording the most recent state at the given snap and addressThe entry includes the entire entry at that snap. Parts occluded by more recent snaps are not subtracted from the entry's address range.
- Specified by:
getMostRecentStateEntryin interfaceTraceMemoryOperations- Parameters:
snap- the timeaddress- the location- Returns:
- the entry including the entire recorded range
-
getViewMostRecentStateEntry
public Map.Entry<TraceAddressSnapRange,TraceMemoryState> getViewMostRecentStateEntry(long snap, AddressRange range, Predicate<TraceMemoryState> predicate) Description copied from interface:TraceMemoryOperationsGet the entry recording the most recent state since the given snap within the given range that satisfies a given predicate, following schedule forks- Specified by:
getViewMostRecentStateEntryin interfaceTraceMemoryOperations- Parameters:
snap- the latest time to considerrange- the range of addressespredicate- a predicate on the state- Returns:
- the most-recent entry
-
getViewMostRecentStateEntry
public Map.Entry<TraceAddressSnapRange,TraceMemoryState> getViewMostRecentStateEntry(long snap, Address address) Description copied from interface:TraceMemoryOperationsGet the entry recording the most recent state at the given snap and address, following schedule forks- Specified by:
getViewMostRecentStateEntryin interfaceTraceMemoryOperations- Parameters:
snap- the latest time to consideraddress- the address- Returns:
- the most-recent entry
-
getAddressesWithState
public AddressSetView getAddressesWithState(Lifespan snap, AddressSetView set, Predicate<TraceMemoryState> predicate) Description copied from interface:TraceMemoryOperationsGet at least the subset of addresses having state satisfying the given predicateThe implementation may provide a larger view than requested, but within the requested set, only ranges satisfying the predicate may be present. Use
AddressSetView.intersect(AddressSetView)withsetif a strict subset is required.Because
TraceMemoryState.UNKNOWNis not explicitly stored in the map, to compute the set ofTraceMemoryState.UNKNOWNaddresses, use the predicatestate -> state != null && state != TraceMemoryState.UNKNOWNand subtract the result fromset.- Specified by:
getAddressesWithStatein interfaceTraceMemoryOperations- Parameters:
snap- the range of timeset- the set to examinepredicate- a predicate on state to search for- Returns:
- the address set
-
getAddressesWithState
Description copied from interface:TraceMemoryOperationsGet the addresses having state satisfying the given predicateThe implementation may provide a view that updates with changes. Behavior is not well defined for predicates testing for
TraceMemoryState.UNKNOWN.- Specified by:
getAddressesWithStatein interfaceTraceMemoryOperations- Parameters:
snap- the timepredicate- a predicate on state to search for- Returns:
- the address set
-
getAddressesWithState
public AddressSetView getAddressesWithState(Lifespan lifespan, Predicate<TraceMemoryState> predicate) Description copied from interface:TraceMemoryOperationsGet the addresses having state satisfying the given predicate at any time in the specified lifespanThe implementation may provide a view that updates with changes. Behavior is not well defined for predicates testing for
TraceMemoryState.UNKNOWN.- Specified by:
getAddressesWithStatein interfaceTraceMemoryOperations- Parameters:
lifespan- the span of timepredicate- a predicate on state to search for- Returns:
- the address set
-
doGetStates
protected Collection<Map.Entry<TraceAddressSnapRange,TraceMemoryState>> doGetStates(Lifespan span, AddressRange range) -
getStates
public Collection<Map.Entry<TraceAddressSnapRange,TraceMemoryState>> getStates(long snap, AddressRange range) Description copied from interface:TraceMemoryOperationsBreak a range of addresses into smaller ranges each mapped to its state at the given snapNote that
TraceMemoryState.UNKNOWNentries will not appear in the result. Gaps in the returned entries are implied to beTraceMemoryState.UNKNOWN.- Specified by:
getStatesin interfaceTraceMemoryOperations- Parameters:
snap- the timerange- the range to examine- Returns:
- the map of ranges to states
-
getMostRecentStates
public Iterable<Map.Entry<TraceAddressSnapRange,TraceMemoryState>> getMostRecentStates(TraceAddressSnapRange within) Description copied from interface:TraceMemoryOperationsBreak a range of addresses into smaller ranges each mapped to its most recent state at the given timeTypically
withinis the box whose width is the address range to break down and whose height is from "negative infinity" to the "current" snap.In this context, "most recent" means the latest state other than
TraceMemoryState.UNKNOWN.- Specified by:
getMostRecentStatesin interfaceTraceMemoryOperations- Parameters:
within- a box intersecting entries to consider- Returns:
- an iterable over the snap ranges and states
-
putBytes
Description copied from interface:TraceMemoryOperationsWrite bytes at the given snap and addressThis will attempt to read
Buffer.remaining()bytes starting atBuffer.position()from the source bufferbufand write them into memory at the specified time and location. The affected region is also updated toTraceMemoryState.KNOWN. The written bytes are assumed effective for all future snaps up to the next write.- Specified by:
putBytesin interfaceTraceMemoryOperations- Parameters:
snap- the timestart- the locationbuf- the source buffer of bytes- Returns:
- the number of bytes written
-
getBytes
Description copied from interface:TraceMemoryOperationsRead the most recent bytes from the given snap and addressThis will attempt to read
Buffer.remaining()of the most recent bytes from memory at the specified time and location and write them into the destination bufferbufstarting atBuffer.position(). Where bytes in memory have no defined value, values in the destination buffer are unspecified. The implementation may leave those bytes in the destination buffer unmodified, or it may write zeroes.- Specified by:
getBytesin interfaceTraceMemoryOperations- Parameters:
snap- the timestart- the locationbuf- the destination buffer of bytes- Returns:
- the number of bytes read
-
getViewBytes
Description copied from interface:TraceMemoryOperationsRead the most recent bytes from the given snap and address, following schedule forksThis behaves similarly to
TraceMemoryOperations.getBytes(long, Address, ByteBuffer), except it checks for theTraceMemoryState.KNOWNstate among each involved snap range and reads the applicable address ranges, preferring the most recent. Where memory is never known the buffer is left unmodified.- Specified by:
getViewBytesin interfaceTraceMemoryOperations- Parameters:
snap- the timestart- the locationbuf- the destination buffer of bytes- Returns:
- the number of bytes read
-
removeBytes
Description copied from interface:TraceMemoryOperationsRemove bytes from the given time and locationThis deletes all observed bytes from the given address through length at the given snap. If there were no observations in the range at exactly the given snap, this has no effect. If there were, then those observations are removed. The next time those bytes are read, they will have a value from a previous snap, or no value at all. The affected region's state is also deleted, i.e., set to
null, implyingTraceMemoryState.UNKNOWN.Note, use of this method is discouraged. The more observations within the same range that follow the deleted observation, the more expensive this operation typically is, since all of those observations may need to be updated.
- Specified by:
removeBytesin interfaceTraceMemoryOperations- Parameters:
snap- the timestart- the locationlen- the number of bytes to remove
-
findBytes
public Address findBytes(long snap, AddressRange range, ByteBuffer data, ByteBuffer mask, boolean forward, TaskMonitor monitor) Description copied from interface:TraceMemoryOperationsSearch the given address range at the given snap for a given byte pattern- Specified by:
findBytesin interfaceTraceMemoryOperations- Parameters:
snap- the time to searchrange- the address range to searchdata- the values to search formask- a mask on the bits ofdata; or null to match all bytes exactlyforward- true to return the match with the lowest address inrange, false for the highest address.monitor- a monitor for progress reporting and canceling- Returns:
- the minimum address of the matched bytes, or
nullif not found
-
getBufferAt
Description copied from interface:TraceMemoryOperationsGet a view of a particular snap as a memory bufferThe bytes read by this buffer are the most recent bytes written before the given snap
- Specified by:
getBufferAtin interfaceTraceMemoryOperations- Parameters:
snap- the snapstart- the starting addressbyteOrder- the byte ordering for this buffer- Returns:
- the memory buffer
-
getSnapOfMostRecentChangeToBlock
Description copied from interface:TraceMemoryOperationsFind the internal storage block that most-recently defines the value at the given snap and address, and return the block's snap.This method reveals portions of the internal storage so that clients can optimize difference computations by eliminating corresponding ranges defined by the same block. If the underlying implementation cannot answer this question, this returns the given snap.
- Specified by:
getSnapOfMostRecentChangeToBlockin interfaceTraceMemoryOperations- Parameters:
snap- the timeaddress- the location- Returns:
- the most snap for the most recent containing block
-
getBlockSize
public int getBlockSize()Description copied from interface:TraceMemoryOperationsGet the block size used by internal storage.This method reveals portions of the internal storage so that clients can optimize searches. If the underlying implementation cannot answer this question, this returns 0.
- Specified by:
getBlockSizein interfaceTraceMemoryOperations- Returns:
- the block size
-
pack
public void pack()Description copied from interface:TraceMemoryOperationsOptimize storage spaceThis gives the implementation an opportunity to clean up garbage, apply compression, etc., in order to best use the storage space. Because memory observations can be sparse, a trace's memory is often compressible, and observations are not often modified or deleted, packing is recommended whenever the trace is saved to disk.
- Specified by:
packin interfaceTraceMemoryOperations
-
getStateChanges
public Collection<Map.Entry<TraceAddressSnapRange,TraceMemoryState>> getStateChanges(long from, long to) Description copied from interface:TraceMemoryManagerCollect all the state changes between two given snaps- Specified by:
getStateChangesin interfaceTraceMemoryManager- Parameters:
from- the earlier snapto- the later snap- Returns:
- the collection of state changes
-