Class DBTraceStaticMappingManager
- All Implemented Interfaces:
ErrorHandler,DBTraceManager,TraceStaticMappingManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DBHandleprotected final ReadWriteLockprotected final DBCachedObjectIndex<Address, DBTraceStaticMapping> protected final DBCachedObjectStore<DBTraceStaticMapping> protected final DBTraceOverlaySpaceAdapterprotected final DBTraceprotected final Collection<DBTraceStaticMapping> -
Constructor Summary
ConstructorsConstructorDescriptionDBTraceStaticMappingManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, DBTrace trace, DBTraceOverlaySpaceAdapter overlayAdapter) -
Method Summary
Modifier and TypeMethodDescriptionadd(AddressRange range, Lifespan lifespan, URL toProgramURL, String toAddress) Add a new mapping, if not already coveredvoidNotification that an IO exception occurred.voiddelete(DBTraceStaticMapping mapping) Collection<? extends DBTraceStaticMapping> findAllOverlapping(AddressRange range, Lifespan lifespan) Find all mappings which overlap the given adddress range and span of timefindAnyConflicting(AddressRange range, Lifespan lifespan, URL toProgramURL, String toAddress) Check if another mapping would conflict with the given prospective mappingfindContaining(Address address, long snap) Find any mapping applicable to the given snap and addressCollection<? extends DBTraceStaticMapping> Get all mappings in the managervoidinvalidateCache(boolean all) Invalidate this manager's caches
-
Field Details
-
dbh
-
lock
-
trace
-
overlayAdapter
-
mappingStore
-
mappingsByAddress
-
view
-
-
Constructor Details
-
DBTraceStaticMappingManager
public DBTraceStaticMappingManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, DBTrace trace, DBTraceOverlaySpaceAdapter overlayAdapter) throws VersionException, IOException - Throws:
VersionExceptionIOException
-
-
Method Details
-
invalidateCache
public void invalidateCache(boolean all) Description copied from interface:DBTraceManagerInvalidate this manager's caches- Specified by:
invalidateCachein interfaceDBTraceManager- Parameters:
all- probably nothing. Check out implementations ofManagerDB.invalidateCache(boolean).
-
dbError
Description copied from interface:ErrorHandlerNotification that an IO exception occurred.- Specified by:
dbErrorin interfaceErrorHandler- Parameters:
e-IOExceptionwhich was cause of error
-
add
public DBTraceStaticMapping add(AddressRange range, Lifespan lifespan, URL toProgramURL, String toAddress) throws TraceConflictedMappingException Description copied from interface:TraceStaticMappingManagerAdd a new mapping, if not already coveredA new mapping may overlap an existing mapping, so long as they agree in address shift. Furthermore, in such cases, the implementation may coalesce mappings to remove duplication.
- Specified by:
addin interfaceTraceStaticMappingManager- Parameters:
range- the range in the trace ("from")lifespan- the span of time in the tracetoProgramURL- the (Ghidra) URL of the static image ("to")toAddress- the starting address (in string form) in the static image ("to")- Returns:
- the new entry, or any entry which subsumes the specified mapping
- Throws:
TraceConflictedMappingException- if an existing mapping conflicts. SeeTraceStaticMappingManager.findAnyConflicting(AddressRange, Lifespan, URL, String)
-
getAllEntries
Description copied from interface:TraceStaticMappingManagerGet all mappings in the manager- Specified by:
getAllEntriesin interfaceTraceStaticMappingManager- Returns:
- the collection of mappings
-
findContaining
Description copied from interface:TraceStaticMappingManagerFind any mapping applicable to the given snap and address- Specified by:
findContainingin interfaceTraceStaticMappingManager- Parameters:
address- the addresssnap- the snap- Returns:
- the mapping, or
nullif none exist at the given location
-
findAnyConflicting
public DBTraceStaticMapping findAnyConflicting(AddressRange range, Lifespan lifespan, URL toProgramURL, String toAddress) Description copied from interface:TraceStaticMappingManagerCheck if another mapping would conflict with the given prospective mappingMappings are allowed to overlap, but they must agree on the destination program and address throughout all overlapping portions.
TODO: It'd be nice if the manager automatically merged overlapping mappings in agreement or provided a "de-duplicate" method which optimized the entries in the database. This gets complicated, since we're dealing with overlapping rectangles, not strict one-dimensional ranges. Look into existing research for optimizing coverage of shapes by rectangles. The same is needed for property maps in 2 dimensions.
- Specified by:
findAnyConflictingin interfaceTraceStaticMappingManager- Parameters:
range- the range in the trace ("from")lifespan- the span of time in the tracetoProgramURL- the (Ghidra) URL of the static image ("to")toAddress- the starting address (in string form) in the static image ("to")- Returns:
- a conflicting mapping, or
nullif none exist
-
findAllOverlapping
public Collection<? extends DBTraceStaticMapping> findAllOverlapping(AddressRange range, Lifespan lifespan) Description copied from interface:TraceStaticMappingManagerFind all mappings which overlap the given adddress range and span of timeNote, this returns overlapping entries whether or not they conflict.
- Specified by:
findAllOverlappingin interfaceTraceStaticMappingManager- Parameters:
range- the range in the trace ("from")lifespan- the span of time in the trace- Returns:
- an unmodifiable collection of overlapped entries
-
delete
-