TraceThread createToyLoopTrace() throws Throwable {
		createAndOpenTrace();

		Address start = tb.addr(0x00400000);
		TraceThread thread;
		try (Transaction tx = tb.startTransaction()) {
			Assembler asm = Assemblers.getAssembler(tb.language);
			AssemblyBuffer buf = new AssemblyBuffer(asm, start);
			buf.assemble("br 0x" + start);

			thread = tb.getOrAddThread("Threads[0]", 0);
			tb.exec(0, thread, 0, "pc = 0x" + start + ";");
			tb.trace.getMemoryManager().putBytes(0, start, ByteBuffer.wrap(buf.getBytes()));
		}
		return thread;
	}
Tests for target control and state editing

<p>
In these and other control service integration tests, we use {@link ControlMode#RW_EMULATOR} as a
stand-in for any mode. We also use {@link ControlMode#RO_TARGET} just to verify the mode is
heeded. Other modes may be tested if bugs crop up in various combinations.
Ghidra/Test/DebuggerIntegrationTest/src/test/java/ghidra/app/plugin/core/debug/gui/control/DebuggerControlPluginTest.java