Class AbstractBaseDBTraceDefinedUnitsView<T extends AbstractDBTraceCodeUnit<T>>
- Type Parameters:
T-
- Direct Known Subclasses:
DBTraceDefinedDataView,DBTraceInstructionsView
This is note a base class of DBTraceDefinedUnitsView. This class supports the
implementation of one or the other: Instruction or Defined data. DBTraceDefinedUnitsView
is the implementation of the composition of both.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classCache for optimizinggetAt(long, Address)protected classCache for optimizinggetFloor(long, Address)and similar. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final intprotected final AbstractBaseDBTraceDefinedUnitsView<T>.CacheForGetUnitContainingQueriesprotected final AbstractBaseDBTraceDefinedUnitsView<T>.CacheForGetUnitSequenceQueriesprotected final DBTraceAddressSnapRangePropertyMapSpace<T, T> Fields inherited from class ghidra.trace.database.listing.AbstractBaseDBTraceCodeUnitsView
space -
Constructor Summary
ConstructorsConstructorDescriptionAbstractBaseDBTraceDefinedUnitsView(DBTraceCodeSpace space, DBTraceAddressSnapRangePropertyMapSpace<T, T> mapSpace) Construct the view -
Method Summary
Modifier and TypeMethodDescriptionvoidclear(Lifespan span, AddressRange range, boolean clearContext, TaskMonitor monitor) protected voidclearContext(Lifespan span, AddressRange range) Clear the register context in the given boxprotected longcomputeTruncatedMax(Lifespan lifespan, T extending, AddressRange range) booleancontainsAddress(long snap, Address address) booleancoversRange(Lifespan span, AddressRange range) getAddressSetView(long snap, AddressRange within) getCeiling(long snap, Address min) getContaining(long snap, Address address) booleanintersectsRange(Lifespan lifespan, AddressRange range) voidInvalidate the query-optimizing caches for this viewintsize()protected Set<TraceAddressSnapRange> subtractFrom(Lifespan span, AddressRange range, Set<TraceAddressSnapRange> cur, Set<TraceAddressSnapRange> set1, Set<TraceAddressSnapRange> set2) Subtract from cur, the boxes covered by the entries intersecting the given query boxprotected LifespantruncateSoonestDefined(Lifespan span, AbstractDBTraceCodeUnit<?> extending, AddressRange range) Select a sub-lifespan from that given so that the box does not overlap an existing unitprotected voidunitRemoved(T unit) Notify domain object listeners that a unit was removedprotected voidunitSpanChanged(Lifespan oldSpan, T unit) Notify domain object listeners taht a unit's lifespan changedMethods inherited from class ghidra.trace.database.listing.AbstractBaseDBTraceCodeUnitsView
coversRange, get, get, get, get, getAddressSetView, getAddressSpace, getAfter, getBefore, getSpace, getTrace, intersectsRange
-
Field Details
-
CACHE_MAX_REGIONS
protected static final int CACHE_MAX_REGIONS- See Also:
-
CACHE_ADDRESS_BREADTH
protected static final int CACHE_ADDRESS_BREADTH- See Also:
-
CACHE_MAX_POINTS
protected static final int CACHE_MAX_POINTS- See Also:
-
mapSpace
protected final DBTraceAddressSnapRangePropertyMapSpace<T extends AbstractDBTraceCodeUnit<T>,T extends AbstractDBTraceCodeUnit<T>> mapSpace -
cacheForContaining
protected final AbstractBaseDBTraceDefinedUnitsView<T extends AbstractDBTraceCodeUnit<T>>.CacheForGetUnitContainingQueries cacheForContaining -
cacheForSequence
protected final AbstractBaseDBTraceDefinedUnitsView<T extends AbstractDBTraceCodeUnit<T>>.CacheForGetUnitSequenceQueries cacheForSequence
-
-
Constructor Details
-
AbstractBaseDBTraceDefinedUnitsView
public AbstractBaseDBTraceDefinedUnitsView(DBTraceCodeSpace space, DBTraceAddressSnapRangePropertyMapSpace<T, T> mapSpace) Construct the view- Parameters:
space- the space, bound to an address spacemapSpace- the map storing the actual code unit entries
-
-
Method Details
-
size
public int size()- Specified by:
sizein classAbstractBaseDBTraceCodeUnitsView<T extends AbstractDBTraceCodeUnit<T>>- See Also:
-
containsAddress
- Specified by:
containsAddressin classAbstractBaseDBTraceCodeUnitsView<T extends AbstractDBTraceCodeUnit<T>>- See Also:
-
subtractFrom
protected Set<TraceAddressSnapRange> subtractFrom(Lifespan span, AddressRange range, Set<TraceAddressSnapRange> cur, Set<TraceAddressSnapRange> set1, Set<TraceAddressSnapRange> set2) Subtract from cur, the boxes covered by the entries intersecting the given query boxCompute C = A - B, where A B and C are sets of (possibly overlapping) boxes. A is given by cur, and B is the set of bounding boxes for entries intersecting the query box. Two temporary sets must be provided, and
curmust be identical to one of them. This routine will mutate them. The returned result will be identical to one of them.If repeated subtraction is needed, the temporary sets need only be constructed once. For each subsequent round of subtraction,
curshould be the returned result of the previous round. The final result is the return value of the final round.This is used in the implementation of
AbstractBaseDBTraceCodeUnitsView.coversRange(TraceAddressSnapRange).- Parameters:
span- the lifespan of the query boxrange- the address range of the query boxcur- the set of boxes, identical to one of the temporary working sets.set1- a temporary set for workingset2- a temporary set for working- Returns:
- the result of subtraction, identical to one of the temporary working sets
-
coversRange
- Specified by:
coversRangein classAbstractBaseDBTraceCodeUnitsView<T extends AbstractDBTraceCodeUnit<T>>- See Also:
-
intersectsRange
- Specified by:
intersectsRangein classAbstractBaseDBTraceCodeUnitsView<T extends AbstractDBTraceCodeUnit<T>>- See Also:
-
getFloor
- Specified by:
getFloorin classAbstractBaseDBTraceCodeUnitsView<T extends AbstractDBTraceCodeUnit<T>>- See Also:
-
getContaining
- Specified by:
getContainingin classAbstractBaseDBTraceCodeUnitsView<T extends AbstractDBTraceCodeUnit<T>>- See Also:
-
getAt
- Specified by:
getAtin classAbstractBaseDBTraceCodeUnitsView<T extends AbstractDBTraceCodeUnit<T>>- See Also:
-
getCeiling
- Specified by:
getCeilingin classAbstractBaseDBTraceCodeUnitsView<T extends AbstractDBTraceCodeUnit<T>>- See Also:
-
get
- Specified by:
getin classAbstractBaseDBTraceCodeUnitsView<T extends AbstractDBTraceCodeUnit<T>>- See Also:
-
getIntersecting
- Specified by:
getIntersectingin classAbstractBaseDBTraceCodeUnitsView<T extends AbstractDBTraceCodeUnit<T>>- See Also:
-
getAddressSetView
- Specified by:
getAddressSetViewin classAbstractBaseDBTraceCodeUnitsView<T extends AbstractDBTraceCodeUnit<T>>- See Also:
-
clearContext
Clear the register context in the given box- Parameters:
span- the lifespan of the boxrange- the address range of the box
-
clear
public void clear(Lifespan span, AddressRange range, boolean clearContext, TaskMonitor monitor) throws CancelledException - Throws:
CancelledException- See Also:
-
unitRemoved
Notify domain object listeners that a unit was removed- Parameters:
unit- the removed unit
-
unitSpanChanged
Notify domain object listeners taht a unit's lifespan changed- Parameters:
oldSpan- the old snapunit- the unit (having the new span)
-
truncateSoonestDefined
protected Lifespan truncateSoonestDefined(Lifespan span, AbstractDBTraceCodeUnit<?> extending, AddressRange range) throws CodeUnitInsertionException Select a sub-lifespan from that given so that the box does not overlap an existing unitThe selected lifespan will have the same start snap as that given. The box is the bounding box of a unit the client is trying to create.
- Parameters:
span- the lifespan of the boxextending- if applicable, the unit whose lifespan is being extendedrange- the address range of the box- Returns:
- the selected sub-lifespan
- Throws:
CodeUnitInsertionException- if the start snap is contained in an existing unit
-
computeTruncatedMax
protected long computeTruncatedMax(Lifespan lifespan, T extending, AddressRange range) throws CodeUnitInsertionException - Throws:
CodeUnitInsertionException
-
invalidateCache
public void invalidateCache()Invalidate the query-optimizing caches for this view
-