void clearPlatform(Lifespan span, AddressRange range, DBTraceGuestPlatform guest,
			TaskMonitor monitor) throws CancelledException {
		// Note "makeWay" does not apply here.
		// Units should be enclosed by guest mapping.
		// TODO: Use sub-monitors when available
		monitor.setMessage("Clearing instructions");
		monitor.setMaximum(instructionMapSpace.size()); // This is OK

		instructions.invalidateCache();
		definedData.invalidateCache();
		undefinedData.invalidateCache();

		for (DBTraceInstruction instruction : instructionMapSpace.reduce(
			TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
			monitor.checkCancelled();
			monitor.incrementProgress(1);
			if (instruction.platform != guest) {
				continue;
			}
			instructionMapSpace.deleteData(instruction);
			instructions.unitRemoved(instruction);
		}
		monitor.setMessage("Clearing data");
		monitor.setMaximum(dataMapSpace.size()); // This is OK
		for (DBTraceData dataUnit : dataMapSpace.reduce(
			TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
			monitor.checkCancelled();
			monitor.incrementProgress(1);
			if (dataUnit.platform != guest) {
				continue;
			}
			// TODO: I don't yet have guest-language data units.
			dataMapSpace.deleteData(dataUnit);
			definedData.unitRemoved(dataUnit);
		}
	}
Clear all units belonging to the given guest platform

@param span the lifespan
@param range the address range
@param guest the guest platform
@param monitor a monitor for progress
@throws CancelledException if the monitor was cancelled
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/listing/DBTraceCodeSpace.java