@Test
	public void testGuestSinglePUSH() throws Throwable {
		try (ToyDBTraceBuilder tb = new ToyDBTraceBuilder("Test", "DATA:BE:64:default")) {
			TraceMemoryManager mm = tb.trace.getMemoryManager();
			TraceThread thread;
			TraceGuestPlatform x64;
			try (Transaction tx = tb.startTransaction()) {
				SchemaContext ctx = XmlSchemaContext.deserialize(DBTraceObjectManagerTest.XML_CTX);
				DBTraceObjectManager objects = tb.trace.getObjectManager();
				objects.createRootObject(ctx.getSchema(new SchemaName("Session")));
				thread = tb.getOrAddThread("Targets[0].Threads[0]", 0);

				mm.addRegion("Targets[0].Memory[bin:.text]", Lifespan.nowOn(0),
					tb.range(0x00000000, 0x0000ffff),
					TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
				mm.addRegion("Targets[0].Memory[stack1]", Lifespan.nowOn(0),
					tb.range(0x20000000, 0x2000ffff),
					TraceMemoryFlag.READ, TraceMemoryFlag.WRITE);

				x64 = tb.trace.getPlatformManager()
						.addGuestPlatform(getSLEIGH_X86_64_LANGUAGE().getDefaultCompilerSpec());
				x64.addMappedRegisterRange();
				x64.addMappedRange(tb.addr(0x00000000), tb.addr(x64, 0x00400000), 0x10000);
				x64.addMappedRange(tb.addr(0x20000000), tb.addr(x64, 0x00100000), 0x10000);
				objects.createObject(KeyPath.parse("Targets[0].Threads[0].Registers"))
						.insert(Lifespan.nowOn(0), ConflictResolution.DENY);

				tb.exec(x64, 0, thread, 0, """
						RIP = 0x00400000;
						RSP = 0x00110000;
						""");

				Assembler asm = Assemblers.getAssembler(x64.getLanguage());
				AssemblyBuffer buf = new AssemblyBuffer(asm, tb.addr(x64, 0x00400000));
				buf.assemble("PUSH 0x0dedbeef");
				mm.putBytes(0, tb.addr(0x00000000), ByteBuffer.wrap(buf.getBytes()));
			}

			BytesTracePcodeEmulator emu = new BytesTracePcodeEmulator(x64, 0);
			PcodeThread<byte[]> emuThread = emu.newThread(thread.getPath());
			emuThread.stepInstruction();

			String changedExpr = "*:8 0x2000fff8:8";
			// Verify no changes to trace
			TraceMemorySpace regs = mm.getMemoryRegisterSpace(thread, 0, false);
			assertEquals(BigInteger.valueOf(0x00110000),
				regs.getValue(x64, 0, tb.reg(x64, "RSP")).getUnsignedValue());
			assertEquals(BigInteger.valueOf(0),
				TraceSleighUtils.evaluate(changedExpr, tb.trace, 0, thread, 0));

			try (Transaction tx = tb.startTransaction()) {
				emu.writeDown(x64, 1, 1);
			}

			assertEquals(BigInteger.valueOf(0x0010fff8),
				regs.getValue(x64, 1, tb.reg(x64, "RSP")).getUnsignedValue());
			assertEquals(new BigInteger("efbeed0d00000000", 16), // Guest is LE, host is BE
				TraceSleighUtils.evaluate(changedExpr, tb.trace, 1, thread, 0));
		}
	}
Test a single instruction in guest mode without identical mapping

<p>
This is a repeat of the {@link #testSinglePUSH()} test, but as a guest platform, where the
guest is mapped to addresses with shifted offsets (not identical). This will ensure the
translation is happening properly.
Ghidra/Debug/Framework-TraceModeling/src/test/java/ghidra/pcode/exec/trace/BytesTracePcodeEmulatorTest.java