public VariableSymbolDB createVariableSymbol(String name, FunctionDB function, SymbolType type,
			int firstUseOffsetOrOrdinal, VariableStorage storage, SourceType source)
			throws DuplicateNameException, InvalidInputException {

		if (type != SymbolType.PARAMETER && type != SymbolType.LOCAL_VAR) {
			throw new IllegalArgumentException("Invalid symbol type for variable: " + type);
		}

		checkValidNamespaceArgument(function);

		lock.acquire();
		try {
			source = adjustSourceTypeIfNecessary(name, type, source, storage);
			Address varAddr = variableStorageMgr.getVariableStorageAddress(storage, true);
			DBRecord record =
				doCreateBasicSymbolRecord(name, function, varAddr, type, false, source, true);
			VariableSymbolDB.setRecordFields(record, firstUseOffsetOrOrdinal, null);
			adapter.updateSymbolRecord(record);

			VariableSymbolDB newSymbol =
				new VariableSymbolDB(this, cache, type, variableStorageMgr, varAddr, record);

			symbolAdded(newSymbol);
			return newSymbol;
		}
		catch (IOException e) {
			program.dbError(e); // will not return
			return null;
		}
		finally {
			lock.release();
		}
	}
Creates variable symbols.
<p>
Note this is not a method defined in the Symbol Table interface. It is intended to be used by
Ghidra program internals.

@param name the name of the variable
@param function the function that contains the variable.
@param type the type of the variable (can only be PARAMETER or LOCAL_VAR)
@param firstUseOffsetOrOrdinal the offset in the function where the variable is first used.
@param storage the VariableStorage (stack, registers, etc.)
@param source the symbol source type (user defined, analysis, etc.)
@return the new VariableSymbol that was created.
@throws DuplicateNameException if there is another variable in this function with that name.
@throws InvalidInputException if the name contains illegal characters (space for example)
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/SymbolManager.java