@Test
	public void testOnEventsObjfiles() throws Exception {
		String print = DummyProc.which("expPrint");
		String modPrint = "Inferiors[1].Modules[%s]".formatted(print);
		try (GdbAndTrace conn = startAndSyncGdb()) {
			conn.execute("""
					file %s
					start""".formatted(print));
			waitForPass(() -> assertEquals(1, tb.objValues(lastSnap(conn), modPrint).size()),
				RUN_TIMEOUT_MS, RETRY_MS);

			conn.execute("continue");
			waitState(1, () -> lastSnap(conn), TraceExecutionState.TERMINATED);
			/**
			 * Termination does not clear objfiles. Not until we run a new target.
			 */
			conn.execute("""
					file bash
					set args -c "exit 1"
					run""");
			waitForPass(() -> assertEquals(0, tb.objValues(lastSnap(conn), modPrint).size()),
				RUN_TIMEOUT_MS, RETRY_MS);
		}
	}
Test on_clear_objfiles, on_new_objfile, on_free_objfile.

<p>
Technically, this probably doesn't hit on_free_objfile, but all three just call
modules_changed, so I'm not concerned.
Ghidra/Test/DebuggerIntegrationTest/src/test.slow/java/agent/gdb/rmi/GdbHooksTest.java