public static void updateIndexedAddressField(Table table, int addrCol, AddressMap addrMap,
			Address fromAddr, Address toAddr, long length, RecordFilter filter, TaskMonitor monitor)
			throws IOException, CancelledException {
		if (length <= 0) {
			throw new IllegalArgumentException("length must be > 0");
		}
		try {
			fromAddr.addNoWrap(length - 1);
			toAddr.addNoWrap(length - 1);
		}
		catch (AddressOverflowException e) {
			throw new IllegalArgumentException("Illegal range: end range overflow");
		}
		boolean startFromTop = fromAddr.compareTo(toAddr) > 0;
		DBFieldIterator it = new AddressIndexPrimaryKeyIterator(table, addrCol, addrMap,
			new AddressSet(fromAddr, fromAddr.add(length - 1)), startFromTop);
		while (startFromTop ? it.hasNext() : it.hasPrevious()) {
			if (monitor.isCancelled()) {
				throw new CancelledException();
			}
			Field key = startFromTop ? it.next() : it.previous();
			DBRecord rec = table.getRecord(key);
			if (filter == null || filter.matches(rec)) {
				Address addr = addrMap.decodeAddress(rec.getLongValue(addrCol));
				addr = toAddr.add(addr.subtract(fromAddr));
				rec.setLongValue(addrCol, addrMap.getKey(addr, true));
				table.putRecord(rec);
			}
		}
	}
Updates an indexed address field for when a block is moved.
@param table the database table
@param addrCol the address column in the table
@param addrMap the address map
@param fromAddr the from address of the block being moved
@param toAddr the address to where the block is being moved.
@param length the size of the block being moved.
@param monitor the task monitor
@throws IOException thrown if a database io error occurs.
@throws CancelledException thrown if the user cancels the move operation.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/util/DatabaseTableUtils.java