@Test
	public void testWriteEmuRegister() throws Throwable {
		createAndOpenTrace();
		controlService.setCurrentMode(tb.trace, ControlMode.RW_EMULATOR);

		TraceObjectThread thread;
		try (Transaction tx = tb.startTransaction()) {
			// NB. TraceManager should automatically activate the first thread
			thread = tb.createObjectsProcessAndThreads();
			tb.createObjectsFramesAndRegs(thread, Lifespan.nowOn(0), getPlatform(), 1);
		}
		activateTrace();
		waitForSwing();

		StateEditor editor = createStateEditor();
		assertTrue(editor.isRegisterEditable(r0));
		waitOn(editor.setRegister(rv1234));
		waitForSwing();

		DebuggerCoordinates current = traceManager.getCurrent();
		long snap = current.getViewSnap();
		assertTrue(Lifespan.isScratch(snap));

		RegisterValue value =
			tb.trace.getMemoryManager()
					.getMemoryRegisterSpace(thread, false)
					.getValue(getPlatform(), snap, r0);
		assertEquals(rv1234, value);
	}
TODO: It'd be nice if this worked, since memory edits don't really require a thread
context. That would require some changes in the TraceSchedule and its execution. IINM,
each step currently requires a thread. We'd have to relax that for patch steps, and it'd
only work if they don't refer to any register.
Ghidra/Test/DebuggerIntegrationTest/src/test/java/ghidra/app/plugin/core/debug/service/control/DebuggerControlServiceTest.java