@Override
	public DBTraceOffsetReference addOffsetReference(Lifespan lifespan, Address fromAddress,
			Address toAddress, boolean toAddrIsBase, long offset, RefType refType,
			SourceType source, int operandIndex) {
		if (operandIndex < -1) {
			throw new IllegalArgumentException("operandIndex");
		}

		try (LockHold hold = LockHold.lock(lock.writeLock())) {

			// Handle EXTERNAL Block offset-reference transformation
			TypeEnum type = TypeEnum.OFFSET;
			boolean isExternalBlockRef = isExternalBlockAddress(lifespan, toAddress);
			boolean badOffsetReference = false;
			if (isExternalBlockRef) {
				type = TypeEnum.OFFSET_EXTERNAL;
				if (!toAddrIsBase) {
					Address baseAddr = toAddress.subtractWrap(offset);
					if (isExternalBlockAddress(lifespan, baseAddr)) {
						toAddress = baseAddr;
						toAddrIsBase = true;
					}
					else {
						// assume unintentional reference into EXTERNAL block
						isExternalBlockRef = false;
						type = TypeEnum.OFFSET;
						badOffsetReference = true;
					}
				}
			}
			else if (toAddrIsBase) {
				toAddress = toAddress.addWrap(offset);
				toAddrIsBase = false;
				if (isExternalBlockAddress(lifespan, toAddress)) {
					badOffsetReference = true;
				}
			}

			if (badOffsetReference) {
				Msg.warn(this, "Offset Reference from " + fromAddress +
					" produces bad Xref into EXTERNAL block");
			}

			makeWay(lifespan, fromAddress, toAddress, operandIndex);

			DBTraceReferenceEntry entry = referenceMapSpace.put(fromAddress, lifespan, null);
			entry.set(toAddress, -1, refType, operandIndex, offset, false, type, source);
			DBTraceOffsetReference ref = new DBTraceOffsetReference(entry, isExternalBlockRef);
			entry.ref = ref;
			manager.doAddXRef(entry);
			return ref;
		}
	}
A reference entry

<p>
Version history:
<ul>
<li>1: Change {@link #toAddress} to 10-byte fixed encoding</li>
<li>0: Initial version and previous unversioned implementation</li>
</ul>
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/symbol/DBTraceReferenceSpace.java