@Override
	public boolean added(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log)
			throws CancelledException {

		long txId = program.getCurrentTransactionInfo().getID();
		if (txId == lastTxId) {
			// Only run once per analysis session - as denoted by being in the same transaction
			return true;
		}
		lastTxId = txId;

		if (isAlreadyImported(program)) {
			Msg.info(this, "DWARF already imported, skipping.");
			return false;
		}

		DWARFSectionProvider dsp =
			DWARFSectionProviderFactory.createSectionProviderFor(program, monitor); // closed by DWARFProgram
		if (dsp == null) {
			Msg.info(this, "Unable to find DWARF information, skipping DWARF analysis");
			return false;
		}

		try {

			if (importOptions.isCopyExternalDebugFileSymbols() &&
				dsp instanceof ExternalDebugFileSectionProvider extDSP) {

				ExternalDebugFileSymbolImporter extDFSI = new ExternalDebugFileSymbolImporter(
					program, extDSP.getExternalProgram(), monitor);
				extDFSI.importSymbols(log);
			}

			try (DWARFProgram prog = new DWARFProgram(program, importOptions, monitor, dsp)) {
				if (prog.getRegisterMappings() == null && importOptions.isImportFuncs()) {
					log.appendMsg("No DWARF to Ghidra register mappings found for this program's " +
						"language [%s], function information may be incorrect / incomplete."
								.formatted(program.getLanguageID().getIdAsString()));
				}
				prog.init(monitor);

				DWARFImporter importer = new DWARFImporter(prog, monitor);
				DWARFImportSummary importResults = importer.performImport();
				importResults.logSummaryResults();
			}
			Options propList = program.getOptions(Program.PROGRAM_INFO);
			propList.setBoolean(DWARF_LOADED_OPTION_NAME, true);
			dsp.updateProgramInfo(program);
			return true;
		}
		catch (CancelledException ce) {
			throw ce;
		}
		catch (IOException e) {
			log.appendMsg("Error during DWARFAnalyzer import: " + e);
			Msg.error(this, "Error during DWARFAnalyzer import: ", e);
		}
		return false;
	}
Returns true if DWARF has already been imported into the specified program.

@param program {@link Program} to check
@return true if DWARF has already been imported, false if not yet
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/DWARFAnalyzer.java