final void initializeOverlaySpaces(ProgramAddressFactory factory) throws IOException {

		RecordIterator it = getOverlayRecords();
		while (it.hasNext()) {
			DBRecord rec = it.next();
			try {
				String spaceName = rec.getString(OV_SPACE_NAME_COL);
				if (factory.getAddressSpace(spaceName) != null) {
					throw new DuplicateNameException("Overlay space '" + spaceName +
						"' duplicates name of another address space");
				}

				String baseSpaceName = rec.getString(OV_SPACE_BASE_COL);
				AddressSpace space = factory.getAddressSpace(baseSpaceName);
				if (space == null) {
					throw new RuntimeException("Overlay base space '" + baseSpaceName +
						"' not found for overlay space '" + spaceName + "'");
				}
				factory.addOverlaySpace(rec.getKey(), spaceName, space);
			}
			catch (Exception e) {
				throw new IOException("Unexpected error initializing overlay address spaces", e);
			}
		}
	}
Adds existing overlay spaces to the factory.
@param factory the program address factory to add overlay spaces to
@throws IOException if database error occurs
@throws RuntimeException for various unsupported address space naming conditions
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/OverlaySpaceDBAdapter.java