@Override
	protected void locationChanged(ProgramLocation location) {
		if (!showingSecondProgram) {
			return;
		}

		if (location == null) {
			return;
		}

		if (settingLocation) {
			return;
		}

		if (location.equals(previousP1Location)) {
			return;
		}

		// Is location from primary program?
		if (location.isValid(primaryProgram)) {
			previousP1Location = location;
		}
		else { // Otherwise location is from Diff program.
			Address addr = location.getAddress();
			Address byteAddr = location.getByteAddress();
			Address refAddr = location.getRefAddress();
			Address primaryAddr =
				SimpleDiffUtility.getCompatibleAddress(secondaryDiffProgram, addr, primaryProgram);
			if (primaryAddr == null) {
				return;
			}

			Address primaryByteAddr = SimpleDiffUtility.getCompatibleAddress(secondaryDiffProgram,
				byteAddr, primaryProgram);
			if (primaryByteAddr == null) {
				primaryByteAddr = primaryAddr; // Make sure the byte address isn't null.
			}
			Address primaryRefAddr = SimpleDiffUtility.getCompatibleAddress(secondaryDiffProgram,
				refAddr, primaryProgram);
			ProgramLocation newP1Location = new ProgramLocation(primaryProgram, primaryAddr,
				primaryByteAddr, location.getComponentPath(), primaryRefAddr, 0, 0, 0);
			previousP1Location = newP1Location;
		}

		Address p1LocationAddress = previousP1Location.getAddress();
		Address p2LocationAddress = SimpleDiffUtility.getCompatibleAddress(primaryProgram,
			p1LocationAddress, secondaryDiffProgram);
		if (p2LocationAddress != null) {
			MarkerSet cursorMarkers = getCursorMarkers();
			cursorMarkers.setAddressSet(new AddressSet(p2LocationAddress));
		}

		try {
			settingLocation = true;
			if (diffControl != null) {
				diffControl.setLocation(previousP1Location.getAddress());
			}
			ProgramLocation previousP1LocationAsP2 = DiffUtility
					.getCompatibleProgramLocation(primaryProgram, location, secondaryDiffProgram);
			if (previousP1LocationAsP2 != null) {
				diffListingPanel.setCursorPosition(previousP1LocationAsP2);
			}
			if (diffDetailsProvider != null && diffDetails != null) {
				diffDetailsProvider.locationChanged(previousP1Location);
			}
		}
		finally {
			settingLocation = false;
		}
	}
Creates the plugin for indicating program differences to the user.

@param tool the tool that owns this plugin.
Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/ProgramDiffPlugin.java