@Override
	public Function getFunctionContaining(Address addr) {

		if (addr.isExternalAddress()) {
			return getFunctionAt(addr);
		}

		lock.acquire();
		try {
			if (lastFuncID != -1) {
				FunctionDB func = cache.get(lastFuncID);
				if (func != null && func.getBody().contains(addr)) {
					return func;
				}
			}
			Namespace scope = namespaceMgr.getNamespaceContaining(addr);
			Symbol symbol = scope.getSymbol();
			while (symbol != null && symbol.getSymbolType() != SymbolType.FUNCTION) {
				symbol = symbol.getParentSymbol();
			}
			if (symbol == null) {
				return null;
			}
			return getFunction(symbol.getID());
		}
		finally {
			lock.release();
		}
	}
Get the function with the given key.
@param key ID of the function; ID is obtained by calling
Function.getID()
@return null if there is no function with the given key
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/function/FunctionManagerDB.java