@Override
	public CodeBlock[] getCodeBlocksContaining(Address addr, TaskMonitor monitor)
			throws CancelledException {

		CodeBlock[] blocks = new CodeBlock[1];

		// First check out the Block cache
		blocks[0] = foundModelP.getFirstBlockContaining(addr);
		if (blocks[0] != null) {
			return blocks;
		}

		/* Get Model-M subroutine that contains addr.  If only one
		entry point, then return it in blocks[0].  If multiple
		entry points, need to find all model-P subroutines and return
		the one that contains addr in blocks[0] */
		CodeBlock modelMSub = modelM.getFirstCodeBlockContaining(addr, monitor);
		if (modelMSub == null) {
			return emptyArray;
		}
		Address[] entPts = modelMSub.getStartAddresses();
		AddressSet modelMSet = new AddressSet(modelMSub);
		if (entPts.length == 1) { // if one entry point ...
			// make this a model-P subroutine
			blocks[0] = createSub(modelMSet, entPts[0]);
			return blocks;
		}
		/* get all model-P code blocks that are contained in the
		                model-M code block and return the one containing addr */
		CodeBlock[] subs = getModelPSubs(modelMSub, monitor);
		for (CodeBlock sub : subs) {
			if (sub.contains(addr)) {
				blocks[0] = sub;
				return blocks;
			}
		}
		return emptyArray;
	}
Get all the Code Blocks containing the address.
For model-P, there is only one.

@param addr   Address to find a containing block.
@param monitor task monitor which allows user to cancel operation.
@return A CodeBlock array with one entry containing the subroutine that
             contains the address null otherwise.
@throws CancelledException if the monitor cancels the operation.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/block/PartitionCodeSubModel.java