@Test
	public void testWriteStateMemory() throws Throwable {
		try (ToyDBTraceBuilder tb = new ToyDBTraceBuilder("Test", "x86:LE:64:default")) {
			initTrace(tb, "", List.of());

			TaintTracePcodeEmulator emu = new TaintTracePcodeEmulator(tb.host, 0);
			TaintVec taintVal = TaintVec.empties(8);
			TaintSet testTaint = TaintSet.of(new TaintMark("test_0", Set.of()));
			for (int i = 0; i < 4; i++) {
				taintVal.set(i, testTaint);
			}
			emu.getSharedState()
					.setVar(tb.addr(0x00400000), 8, true,
						Pair.of(tb.arr(0, 0, 0, 0, 0, 0, 0, 0), taintVal));

			try (Transaction tx = tb.startTransaction()) {
				emu.writeDown(tb.host, 1, 0);
			}
			TracePropertyMap<String> taintMap =
				tb.trace.getAddressPropertyManager().getPropertyMap("Taint", String.class);
			assertEquals("test_0", taintMap.get(1, tb.addr(0x00400000)));
			assertEquals("test_0", taintMap.get(1, tb.addr(0x00400003)));
			assertNull(taintMap.get(1, tb.addr(0x00400004)));
		}
	}
Test that state is properly read from trace memory

<p>
We isolate exactly a read by executing sleigh.
Ghidra/Debug/TaintAnalysis/src/test/java/ghidra/pcode/emu/taint/trace/TaintTracePcodeEmulatorTest.java