public void clear(Lifespan span, AddressRange range, boolean clearContext,
			TaskMonitor monitor) throws CancelledException {
		long startSnap = span.lmin();
		try (LockHold hold = LockHold.lock(space.lock.writeLock())) {
			cacheForContaining.invalidate();
			cacheForSequence.invalidate();
			for (T unit : mapSpace.reduce(
				TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
				monitor.checkCancelled();
				if (unit.getStartSnap() < startSnap) {
					Lifespan oldSpan = unit.getLifespan();
					if (clearContext) {
						clearContext(Lifespan.span(span.lmin(), oldSpan.lmax()), unit.getRange());
					}
					unit.setEndSnap(startSnap - 1);
				}
				else {
					if (clearContext) {
						clearContext(unit.getLifespan(), unit.getRange());
					}
					unit.delete();
				}
			}
		}
	}
@see TraceBaseDefinedUnitsView#clear(Lifespan, AddressRange, boolean, TaskMonitor)
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/listing/AbstractBaseDBTraceDefinedUnitsView.java