@Override
	public void setLengthOverride(int length) throws CodeUnitInsertionException {
		int oldLengthOverride = this.lengthOverride;
		try (LockHold hold = space.trace.lockWrite()) {
			checkDeleted();
			InstructionPrototype proto = getPrototype();
			length = InstructionDB.checkLengthOverride(length, proto);
			if (length == lengthOverride) {
				return; // no change
			}

			int newLength = length != 0 ? length : proto.getLength();
			if (newLength > getLength()) {
				Address minAddr = getMinAddress();
				Address newEndAddr = minAddr.add(newLength - 1);
				TraceAddressSnapRange tasr = new ImmutableTraceAddressSnapRange(
					new AddressRangeImpl(minAddr.next(), newEndAddr), getLifespan());
				for (AbstractDBTraceCodeUnit<?> cu : space.definedUnits.getIntersecting(tasr)) {
					if (cu != this) {
						throw new CodeUnitInsertionException(
							"Length override of " + newLength + " conflicts with code unit at " +
								cu.getMinAddress() + ", lifespan=" + cu.getLifespan());
					}
				}
			}

			updateLengthOverride(length);
		}
		space.trace.setChanged(
			new TraceChangeRecord<>(TraceEvents.INSTRUCTION_LENGTH_OVERRIDE_CHANGED, space, this,
				oldLengthOverride, length));
	}
Set the fields of this record

@param platform the platform
@param prototype the instruction prototype
@param context the context for locating or creating the prototype entry
@param forcedLengthOverride reduced instruction byte-length (1..7) or 0 to use default length
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/listing/DBTraceInstruction.java