@Override
	public DBTraceDataAdapter create(Lifespan lifespan, Address address, TracePlatform platform,
			DataType origType, int origLength) throws CodeUnitInsertionException {
		if (platform.getTrace() != getTrace() ||
			!(platform instanceof InternalTracePlatform iPlatform)) {
			throw new IllegalArgumentException("Platform is not part of this trace");
		}
		try (LockHold hold = LockHold.lock(space.lock.writeLock())) {
			DBTraceMemorySpace memSpace = space.trace.getMemoryManager().get(space, true);
			// NOTE: User-given length could be ignored....
			// Check start address first. After I know length, I can check for other existing units
			long startSnap = lifespan.lmin();
			if (!space.undefinedData.coversRange(Lifespan.at(startSnap),
				new AddressRangeImpl(address, address))) {
				// TODO: Figure out the conflicting unit?
				throw new CodeUnitInsertionException("Code units cannot overlap");
			}

			DataType dataType;
			int length;
			if (origType instanceof FactoryDataType) {
				MemBuffer buffer = memSpace.getBufferAt(startSnap, address);
				FactoryDataType fdt = (FactoryDataType) origType;
				dataType = fdt.getDataType(buffer);
				length = -1;
			}
			else {
				dataType = origType;
				length = origLength;
			}

			if (dataType == null) {
				throw new CodeUnitInsertionException("Failed to resolve data type");
			}
			DataTypeManager dtm = platform.getDataTypeManager();
			dataType = dataType.clone(dtm);

			if (isFunctionDefinition(dataType)) {
				dataType = new PointerDataType(dataType, dtm);
				length = dataType.getLength();
			}
			else if (dataType instanceof Dynamic) {
				// TODO: Should I consider no observations to be "uninitialized"?
				// If so, dynamic types cannot be applied here
				Dynamic dyn = (Dynamic) dataType;
				MemBuffer buffer = memSpace.getBufferAt(startSnap, address);
				length = dyn.getLength(buffer, length);
			}
			else {
				length = dataType.getLength();
			}

			if (length < 0) {
				throw new CodeUnitInsertionException(
					"Failed to resolve data length for " + origType.getName());
			}
			if (length == 0) {
				throw new CodeUnitInsertionException(
					"Zero-length data not allowed " + origType.getName());
			}

			Address endAddress = address.addNoWrap(length - 1);
			AddressRangeImpl createdRange = new AddressRangeImpl(address, endAddress);

			// Truncate, then check that against existing code units.
			long endSnap = computeTruncatedMax(lifespan, null, createdRange);
			TraceAddressSnapRange tasr = new ImmutableTraceAddressSnapRange(createdRange,
				Lifespan.span(startSnap, endSnap));
			if (!space.undefinedData.coversRange(tasr)) {
				// TODO: Figure out the conflicting unit?
				throw new CodeUnitInsertionException("Code units cannot overlap");
			}

			if (dataType == DataType.DEFAULT) {
				return space.undefinedData.getAt(startSnap, address);
			}

			long dataTypeID = dtm.getResolvedID(dataType);
			DBTraceData created = mapSpace.put(tasr, null);
			created.set(iPlatform, dataTypeID);
			// TODO: Explicitly remove undefined from cache, or let weak refs take care of it?

			cacheForContaining.notifyNewEntry(tasr.getLifespan(), createdRange, created);
			cacheForSequence.notifyNewEntry(tasr.getLifespan(), createdRange, created);
			space.undefinedData.invalidateCache();

			if (dataType instanceof Composite || dataType instanceof Array ||
				dataType instanceof Dynamic) {
				// TODO: Track composites?
				space.trace.setChanged(new TraceChangeRecord<>(TraceEvents.COMPOSITE_DATA_ADDED,
					space, tasr, created));
			}

			space.trace.setChanged(
				new TraceChangeRecord<>(TraceEvents.CODE_ADDED, space, tasr, created));
			return created;
		}
		catch (AddressOverflowException e) {
			throw new CodeUnitInsertionException("Could unit would extend beyond address space");
		}
	}
Check if the given data type represents a function definition

<p>
This recursively resolves typedefs and checks each.

@param dt the data type
@return true if it is a function definition, false otherwise
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/listing/DBTraceDefinedDataView.java