@Override
		public void write(long offset, byte[] val, int srcOffset, int length) {
			super.write(offset, val, srcOffset, length);
			Address loc = space.getAddress(offset);
			Address end = loc.addWrap(length - 1);
			if (loc.compareTo(end) <= 0) {
				written.add(loc, end);
			}
			else {
				written.add(loc, space.getMaxAddress());
				written.add(space.getMinAddress(), end);
			}
		}
A state piece which reads bytes from a trace, but caches writes internally.

<p>
This provides for "read-only" emulation on a trace. Writes do not affect the source trace, but
rather are cached in this state. If desired, those cached writes can be written back out at a
later time.
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/BytesTracePcodeExecutorStatePiece.java