Class DBTraceMemorySpace
- All Implemented Interfaces:
InternalTraceMemoryOperations, DBTraceSpaceBased, TraceMemoryOperations, TraceMemorySpace, TraceSpaceMixin
TraceMemorySpace using a database-backed copy-on-write store.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface TraceMemoryOperations
TraceMemoryOperations.StatePredicate -
Field Summary
FieldsChangeModifier and TypeFieldDescriptionprotected final Map<ghidra.trace.database.memory.DBTraceMemorySpace.AddressSetStateCacheKey, AddressSetView> static final intstatic final intstatic final intstatic final intprotected final Map<DBTraceUtils.OffsetSnap, ghidra.trace.database.memory.DBTraceMemoryBlockEntry> static final intprotected final DBCachedObjectIndex<DBTraceUtils.OffsetSnap, ghidra.trace.database.memory.DBTraceMemoryBlockEntry> protected final DBCachedObjectStore<ghidra.trace.database.memory.DBTraceMemoryBlockEntry> protected final DBCachedObjectStore<DBTraceMemoryBufferEntry> protected final DBHandlestatic final intprotected final ReadWriteLockprotected final DBTraceMemoryManagerprotected final Map<ghidra.trace.database.memory.DBTraceMemorySpace.MostRecentStateCacheKey, Map.Entry<TraceAddressSnapRange, TraceMemoryState>> protected final AddressSpacestatic final intstatic final intstatic final intstatic final intstatic final intprotected final DBTraceAddressSnapRangePropertyMapSpace<TraceMemoryState, ghidra.trace.database.memory.DBTraceMemoryStateEntry> protected final DBTraceprotected final DBTraceTimeViewport -
Constructor Summary
ConstructorsChangeConstructorDescriptionDBTraceMemorySpace(DBTraceMemoryManager manager, DBHandle dbh, AddressSpace space, AbstractDBTraceSpaceBasedManager.DBTraceSpaceEntry ent) -
Method Summary
ChangeModifier and TypeMethodDescriptionprotected voidcheckState(TraceMemoryState state) voidprotected booleandoCheckBytesChanged(long snap, AddressRange range, ByteBuffer buf1, ByteBuffer buf2) protected booleandoCheckBytesChanged(DBTraceUtils.OffsetSnap loc, int srcOffset, int maxLen, ByteBuffer eBuf, ByteBuffer pBuf) protected AddressdoFindBytesInRange(long snap, AddressRange range, ByteBuffer data, ByteBuffer mask, boolean forward, TaskMonitor monitor) protected AddressSetViewdoGetAddressesWithState(Lifespan span, AddressSetView set, Predicate<TraceMemoryState> predicate) protected voiddoGetBytes(DBTraceUtils.OffsetSnap loc, ByteBuffer buf, int srcOffset, int maxLen) protected Collection<Map.Entry<TraceAddressSnapRange, TraceMemoryState>> doGetStates(Lifespan span, AddressRange range) protected intdoPutBytes(long snap, Address start, ByteBuffer buf, DBTraceMemorySpace.OutSnap lastSnap, Set<TraceAddressSnapRange> changed) protected voiddoPutBytes(DBTraceUtils.OffsetSnap loc, ByteBuffer buf, int dstOffset, int maxLen) protected voiddoPutFutureBytes(DBTraceUtils.OffsetSnap loc, ByteBuffer buf, int dstOffset, int maxLen, DBTraceMemorySpace.OutSnap lastSnap, Set<TraceAddressSnapRange> changed) protected voiddoPutState(AddressRange range, Lifespan span, TraceMemoryState state) protected voiddoSetState(long snap, Address start, Address end, TraceMemoryState state) protected voiddoTruncateAndPut(long snap, AddressSet remains, TraceMemoryState state) 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 patternfindBytesAcrossLifespan(Lifespan span, AddressRange range, byte[] pattern, TaskMonitor monitor) Search the given range, across a given lifespan, for a byte pattern.protected ghidra.trace.database.memory.DBTraceMemoryBlockEntryfindMostRecentBlockEntry(DBTraceUtils.OffsetSnap loc, boolean inclusive) protected ghidra.trace.database.memory.DBTraceMemoryBlockEntryfindSoonestBlockEntry(DBTraceUtils.OffsetSnap loc, boolean inclusive) Locate the soonest block entry for the given offset-snap pairgetAddressesWithState(long snap, Predicate<TraceMemoryState> predicate) Get the addresses having state satisfying the given predicategetAddressesWithState(Lifespan span, AddressSetView set, Predicate<TraceMemoryState> predicate) Get at least the intersection 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 lifespanGet the address spaceintGet 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 addressCollection<? extends DBTreeRecord<?, ? extends TraceAddressSnapRange>> getChildrenOf(DBTreeNodeRecord<?> rec) For developers and testers.getCodeSpace(boolean createIfAbsent) Get the code space for this memory spaceintgetDepth()For developers and testers.longgetFirstChange(Lifespan span, AddressRange range) Determine the truncation snap if the given span and range include byte changesgetLock()getMostRecentStateEntry(long snap, Address address) Get the entry recording the most recent state at the given snap and addressGet all the entries covering the given range, effective at or extending as "most recent" to the given snap.For developers and testers.getSnapOfMostRecentChangeToBlock(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 addressgetStates(long snap, AddressRange range) Get all the entries covering the given range effective at the given snapgetStates(Lifespan span, AddressRange range) Get all the entries covering the given range effective within the given spangetTrace()Get the trace to which the memory manager belongsintgetViewBytes(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 forksvoidprotected booleanisCross(long lower, long upper) voidpack()Optimize storage spacevoidpaint(DBTraceAddressSnapRangePropertyMapTree.Painter painter, int depth) For developers and testers.intputBytes(long snap, Address start, ByteBuffer buf) Write bytes at the given snap and addressvoidremoveBytes(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 setprotected inttruncateLen(int len, Address start) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DBTraceSpaceBased
assertInSpace, assertInSpace, explainLanguages, isMySpace, toAddress, toOverlayMethods inherited from interface InternalTraceMemoryOperations
getBytes, getState, getStates, getValue, getViewValue, putBytes, removeValue, setState, setValueMethods inherited from interface TraceMemoryOperations
getAddressesWithState, getBufferAt, getBytes, getMostRecentStates, getState, getStates, getValue, getViewValue, isKnown, putBytes, removeValue, setState, setValueMethods inherited from interface TraceSpaceMixin
getFrameLevel, getThread
-
Field Details
-
BLOCK_SHIFT
public static final int BLOCK_SHIFT- See Also:
-
BLOCK_SIZE
public static final int BLOCK_SIZE- See Also:
-
BLOCK_MASK
public static final int BLOCK_MASK- See Also:
-
DEPENDENT_COMPRESSED_SIZE_TOLERANCE
public static final int DEPENDENT_COMPRESSED_SIZE_TOLERANCE- See Also:
-
BLOCK_CACHE_SIZE NEW
public static final int BLOCK_CACHE_SIZE- See Also:
-
BLOCKS_PER_BUFFER
public static final int BLOCKS_PER_BUFFER- See Also:
-
STATE_BLOCK_SHIFT NEW
public static final int STATE_BLOCK_SHIFT- See Also:
-
STATE_BLOCK_SIZE NEW
public static final int STATE_BLOCK_SIZE- See Also:
-
STATE_BLOCK_MASK NEW
public static final int STATE_BLOCK_MASK- See Also:
-
STATE_CACHE_SIZE NEW
public static final int STATE_CACHE_SIZE- See Also:
-
STATE_MR_CACHE_SIZE NEW
public static final int STATE_MR_CACHE_SIZE- See Also:
-
manager
-
dbh
-
space
-
lock
-
trace
-
stateMapSpace
protected final DBTraceAddressSnapRangePropertyMapSpace<TraceMemoryState, ghidra.trace.database.memory.DBTraceMemoryStateEntry> stateMapSpace -
bufferStore
-
blockStore
protected final DBCachedObjectStore<ghidra.trace.database.memory.DBTraceMemoryBlockEntry> blockStore -
blocksByOffset
protected final DBCachedObjectIndex<DBTraceUtils.OffsetSnap, ghidra.trace.database.memory.DBTraceMemoryBlockEntry> blocksByOffset -
blockCacheMostRecent
protected final Map<DBTraceUtils.OffsetSnap, ghidra.trace.database.memory.DBTraceMemoryBlockEntry> blockCacheMostRecent -
addressSetStateCache NEW
protected final Map<ghidra.trace.database.memory.DBTraceMemorySpace.AddressSetStateCacheKey, AddressSetView> addressSetStateCache -
mostRecentStateEntryCache NEW
protected final Map<ghidra.trace.database.memory.DBTraceMemorySpace.MostRecentStateCacheKey, Map.Entry<TraceAddressSnapRange, TraceMemoryState>> mostRecentStateEntryCache -
viewport
-
-
Constructor Details
-
DBTraceMemorySpace
public DBTraceMemorySpace(DBTraceMemoryManager manager, DBHandle dbh, AddressSpace space, AbstractDBTraceSpaceBasedManager.DBTraceSpaceEntry ent) throws IOException, VersionException - Throws:
IOExceptionVersionException
-
-
Method Details
-
getSpace
Description copied from interface:InternalTraceMemoryOperationsFor register mapping conventions- Specified by:
getSpacein interfaceInternalTraceMemoryOperations- Returns:
- the address space
-
getLock
- Specified by:
getLockin interfaceInternalTraceMemoryOperations
-
getTrace
Description copied from interface:TraceMemoryOperationsGet the trace to which the memory manager belongs- Specified by:
getTracein interfaceTraceMemoryOperations- Specified by:
getTracein interfaceTraceSpaceMixin- Returns:
- the trace
-
getCodeSpace
Description copied from interface:TraceMemorySpaceGet the code space for this memory spaceThis is a convenience for
TraceCodeManager.getCodeSpace(AddressSpace, boolean)on this same address space.- Specified by:
getCodeSpacein interfaceTraceMemorySpace- Parameters:
createIfAbsent- true to create the space if it's not already present- Returns:
- the code space
-
getAddressSpace
Description copied from interface:TraceMemorySpaceGet the address space- Specified by:
getAddressSpacein interfaceTraceMemorySpace- Specified by:
getAddressSpacein interfaceTraceSpaceMixin- Returns:
- the address space
-
doPutState NEW
-
doTruncateAndPut NEW
-
doSetState
-
checkState
-
checkStateMapIntegrity
public void checkStateMapIntegrity() -
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
- Specified by:
setStatein interfaceTraceMemoryOperations- See Also:
-
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 may include more addresses and snaps than requested. The address range is largely circumstantial, but may be useful if the client is performing multiple queries in a locality. The lifespan is more important as it indicates the actual effective snapshot (the lower bound) as well as when the next change is (one after the upper bound.)
- Specified by:
getMostRecentStateEntryin interfaceTraceMemoryOperations- Parameters:
snap- the timeaddress- the location- 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
-
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 or null
-
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
-
getAddressesWithState
public AddressSetView getAddressesWithState(Lifespan span, AddressSetView set, Predicate<TraceMemoryState> predicate) Description copied from interface:TraceMemoryOperationsGet at least the intersection of addresses having state satisfying the given predicateThe implementation may provide a larger set than requested, but within the requested set, only ranges satisfying the predicate may be present. Use
AddressSetView.intersect(AddressSetView)withsetif a strict intersection is required.Because
TraceMemoryState.UNKNOWNis not explicitly stored in the map, to compute the set ofTraceMemoryState.UNKNOWNaddresses, use the predicateTraceMemoryOperations.StatePredicate.IS_KNOWN_OR_ERRORand subtract the result fromset.- Specified by:
getAddressesWithStatein interfaceTraceMemoryOperations- Parameters:
span- the range of timeset- the set to examinepredicate- a predicate on state to search for- Returns:
- the address set
-
doGetAddressesWithState
protected AddressSetView doGetAddressesWithState(Lifespan span, AddressSetView set, Predicate<TraceMemoryState> predicate) -
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:TraceMemoryOperationsGet all the entries covering the given range effective 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:TraceMemoryOperationsGet all the entries covering the given range, effective at or extending as "most recent" to the given snap.Typically
withinis the box whose width is the address range and whose height isLifespan.since(long)a desired snap. Queries that respect forking should only extend as far back as the most recent forked snapshot.In this context, "most recent" means the latest state other than
TraceMemoryState.UNKNOWN. The entries returned can overlap. The rule is thatTraceMemoryState.KNOWNentries may not overlap one another. They are split and truncated so that they extend as far as possible into the future without overlapping. ATraceMemoryState.ERRORentry can overlap a less-recentTraceMemoryState.KNOWNentry, but not a more-recent one. This is to ensure the most-recent-known values can still be obtained when the most recent attempt to read bytes resulted in an error.- Specified by:
getMostRecentStatesin interfaceTraceMemoryOperations- Parameters:
within- a box intersecting entries to consider- Returns:
- an iterable over the snap ranges and states
-
findMostRecentBlockEntry
protected ghidra.trace.database.memory.DBTraceMemoryBlockEntry findMostRecentBlockEntry(DBTraceUtils.OffsetSnap loc, boolean inclusive) -
findSoonestBlockEntry
protected ghidra.trace.database.memory.DBTraceMemoryBlockEntry findSoonestBlockEntry(DBTraceUtils.OffsetSnap loc, boolean inclusive) Locate the soonest block entry for the given offset-snap pairTo qualify, the entry must have a snap greater than (or optionally equal to) that given and an offset exactly equal to that given. That is, it is the earliest in time, but most follow the given snap. Additionally, if the given snap is in scratch space, the found entry must also be in scratch space.
- Parameters:
loc- the offset-snap pairinclusive- true to allow equal snap- Returns:
- the found entry, or null
-
doPutBytes
protected void doPutBytes(DBTraceUtils.OffsetSnap loc, ByteBuffer buf, int dstOffset, int maxLen) throws IOException - Throws:
IOException
-
doPutFutureBytes
protected void doPutFutureBytes(DBTraceUtils.OffsetSnap loc, ByteBuffer buf, int dstOffset, int maxLen, DBTraceMemorySpace.OutSnap lastSnap, Set<TraceAddressSnapRange> changed) throws IOException - Throws:
IOException
-
doPutBytes
protected int doPutBytes(long snap, Address start, ByteBuffer buf, DBTraceMemorySpace.OutSnap lastSnap, Set<TraceAddressSnapRange> changed) throws IOException - Throws:
IOException
-
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
-
doGetBytes
protected void doGetBytes(DBTraceUtils.OffsetSnap loc, ByteBuffer buf, int srcOffset, int maxLen) throws IOException - Throws:
IOException
-
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
-
truncateLen
-
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
-
doFindBytesInRange
protected Address doFindBytesInRange(long snap, AddressRange range, ByteBuffer data, ByteBuffer mask, boolean forward, TaskMonitor monitor) -
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
-
doCheckBytesChanged
protected boolean doCheckBytesChanged(DBTraceUtils.OffsetSnap loc, int srcOffset, int maxLen, ByteBuffer eBuf, ByteBuffer pBuf) throws IOException - Throws:
IOException
-
doCheckBytesChanged
protected boolean doCheckBytesChanged(long snap, AddressRange range, ByteBuffer buf1, ByteBuffer buf2) throws IOException - Throws:
IOException
-
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
-
isCross
protected boolean isCross(long lower, long upper) -
getFirstChange
Determine the truncation snap if the given span and range include byte changesCode units do not understand or accommodate changes in time, so the underlying bytes of the unit must be the same throughout its lifespan. Typically, units are placed with a desired creation snap, and then its life is extended into the future opportunistically. Thus, when truncating, we desire to keep the start snap, then search for the soonest byte change within the desired lifespan. Furthermore, we generally don't permit a unit to exist in both record and scratch spaces, i.e., it cannot span both the -1 and 0 snaps.
- Parameters:
span- the desired lifespanrange- the address range covered- Returns:
- the first snap that should be excluded, or
Long.MIN_VALUEto indicate no change.
-
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
TraceMemoryState.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
-
getStates NEW
public Collection<Map.Entry<TraceAddressSnapRange, TraceMemoryState>> getStates(Lifespan span, AddressRange range) Description copied from interface:TraceMemoryOperationsGet all the entries covering the given range effective within the given spanNote that
TraceMemoryState.UNKNOWNentries will not appear in the result. Gaps in the returned entries are implied to beTraceMemoryState.UNKNOWN.- Specified by:
getStatesin interfaceTraceMemoryOperations- Parameters:
span- the time span to examinerange- the range to examine- Returns:
- the map of ranges to states
-
findBytesAcrossLifespan NEW
public List<TraceAddressSnapRange> findBytesAcrossLifespan(Lifespan span, AddressRange range, byte[] pattern, TaskMonitor monitor) Description copied from interface:TraceMemoryOperationsSearch the given range, across a given lifespan, for a byte pattern.Addresses outside the given range may be returned if the pattern matches at the edges of the given range. Full lifespans for each hit are included as long as they intersect the lifespan given.
- Specified by:
findBytesAcrossLifespanin interfaceTraceMemoryOperations- Parameters:
span- the range of timerange- the range to searchpattern- the patternmonitor- a monitor for cancellation/progress- Returns:
- the list of matches, each with the span of time during which it holds
-
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
-
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
-
invalidateCache
public void invalidateCache()- Specified by:
invalidateCachein interfaceDBTraceSpaceBased
-
paint NEW
For developers and testers.- Parameters:
painter- painterdepth- depth
-
getDepth NEW
public int getDepth()For developers and testers.- Returns:
- depth
-
getRootBounds NEW
-
getChildrenOf
public Collection<? extends DBTreeRecord<?, ? extends TraceAddressSnapRange>> getChildrenOf(DBTreeNodeRecord<?> rec) For developers and testers.- Parameters:
rec- record- Returns:
- children
-