private boolean setFunctionDefinition(Function function, Address address)
			throws CancelledException, PdbException {

		RecordNumber typeRecordNumber = symbol.getTypeRecordNumber();
		if (typeRecordNumber == RecordNumber.NO_TYPE) {
			return false; // This will happen for thunks (we set to NO_TYPE specifically)
		}
		// Remaining are non-thunks

		if (function.getSignatureSource().isHigherPriorityThan(SourceType.ANALYSIS)) {
			// return if IMPORTED or USER_DEFINED
			return false;
		}

		// Since the thunk detection algorithms are overly aggressive and make mistakes, we
		//  are specifically clearing the value to override these false positives
		function.setThunkedFunction(null);

		function.setNoReturn(isNonReturning());

		AbstractMsType fType = applicator.getTypeRecord(typeRecordNumber);
		MsTypeApplier applier = applicator.getTypeApplier(fType);
		if (!(applier instanceof AbstractFunctionTypeApplier)) {
			applicator.appendLogMsg("Error: Failed to resolve datatype RecordNumber " +
				typeRecordNumber + " at " + address);
			return false;
		}

		DataType dataType = applicator.getCompletedDataType(typeRecordNumber);
		// Since we know the applier is an AbstractionFunctionTypeApplier, then dataType is either
		//  FunctionDefinition or no type (typedef).
		if (!(dataType instanceof FunctionDefinition)) {
			return false;
		}
		FunctionDefinition def =
			(FunctionDefinition) dataType.copy(applicator.getDataTypeManager());
		try {
			// Must use copy of function definition with preserved function name.
			// While not ideal, this prevents applying an incorrect function name
			// with an IMPORTED source type
			def.setName(function.getName());
		}
		catch (InvalidNameException | DuplicateNameException e) {
			throw new RuntimeException("unexpected exception", e);
		}
		ApplyFunctionSignatureCmd sigCmd =
			new ApplyFunctionSignatureCmd(address, def, SourceType.IMPORTED);
		TaskMonitor monitor = applicator.getCancelOnlyWrappingMonitor();
		if (!sigCmd.applyTo(applicator.getProgram(), monitor)) {
			applicator.appendLogMsg(
				"PDB Warning: Failed to apply signature to function at address " + address +
					" due to " + sigCmd.getStatusMsg() + "; dataType: " + def.getName());
			return false;
		}
		return true;
	}
returns true only if we set a function signature
@return true if function signature was set
@throws PdbException upon processing error
@throws CancelledException upon user cancellation
Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/FunctionSymbolApplier.java