protected DBTraceInstruction doCreate(Lifespan lifespan, Address address,
			InternalTracePlatform platform, InstructionPrototype prototype,
			ProcessorContextView context, int length)
			throws CodeUnitInsertionException, AddressOverflowException {
		if (platform.getLanguage() != prototype.getLanguage()) {
			throw new IllegalArgumentException("Platform and prototype disagree in language");
		}

		int forcedLengthOverride = InstructionDB.checkLengthOverride(length, prototype);
		if (length == 0) {
			length = prototype.getLength();
		}
		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.withMax(endSnap));

		if (!space.undefinedData.coversRange(tasr)) {
			// TODO: Figure out the conflicting unit or snap boundary?
			throw new CodeUnitInsertionException("Code units cannot overlap");
		}

		doSetContext(tasr, prototype.getLanguage(), context);

		DBTraceInstruction created = space.instructionMapSpace.put(tasr, null);
		created.set(platform, prototype, context, forcedLengthOverride);

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

		// TODO: Save the context register into the context manager? Flow it?
		// TODO: Ensure cached undefineds don't extend into defined stuff
		// TODO: Explicitly remove undefined from cache, or let weak refs take care of it?
		return created;
	}
Create an instruction

@param lifespan the lifespan of the instruction
@param address the minimum address of the instruction
@param platform the platform (language, compiler) for the instruction
@param prototype the instruction's prototype
@param context the initial context for parsing the instruction
@param length instruction byte-length (must be in the range 0..prototype.getLength()). If
           smaller than the prototype length it must have a value no greater than 7,
           otherwise an error will be thrown. A value of 0 or greater-than-or-equal the
           prototype length will be ignored and not impose and override length. The length
           value must be a multiple of the {@link Language#getInstructionAlignment()
           instruction alignment} .
@return the newly created instruction.
@throws CodeUnitInsertionException thrown if the new Instruction would overlap and existing
            {@link CodeUnit} or the specified {@code length} is unsupported.
@throws IllegalArgumentException if a negative {@code length} is specified.
@throws AddressOverflowException if the instruction would fall off the address space
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/listing/DBTraceInstructionsView.java