@Override
	public CodeBlock getFirstCodeBlockContaining(Address addr, TaskMonitor monitor)
			throws CancelledException {

		if (addr == null) {
			return null;
		}
		// First check out the Block cache
		Object blocks[] = foundBlockMap.getObjects(addr);
		if (blocks.length > 0) {
			return (CodeBlock) blocks[0];
		}

		if (addr.isExternalAddress()) {
			return getCodeBlockAt(addr, monitor);
		}

		Instruction instr = listing.getInstructionContaining(addr);
		if (instr != null) {

			// search backwards until instruction that starts a block is found
			Address fallFrom = instr.getFallFrom();
			while (!isBlockStart(instr, fallFrom)) {
				if (monitor != null && monitor.isCancelled()) {
					throw new CancelledException();
				}
				if (fallFrom == null) {
					Msg.warn(this, "WARNING: Invalid delay slot or offcut instruction found at " +
						instr.getMinAddress());
					try {
						fallFrom = instr.getMinAddress().subtractNoWrap(1);
					}
					catch (AddressOverflowException e) {
						break;
					}
				}
				instr = listing.getInstructionContaining(fallFrom);
				fallFrom = instr.getFallFrom();
			}
			return getCodeBlockAt(instr, monitor);
		}

		Data data = listing.getDefinedDataContaining(addr);
		if (data != null) {
			return getCodeBlockAt(data.getMinAddress(), monitor);
		}
		return null;
	}
Get the First Code Block that contains the address.

@param addr   Address to find a containing block.
@param monitor task monitor which allows user to cancel operation.
@return A SimpleBlock if any block contains the address.
       null otherwise.
@throws CancelledException if the monitor cancels the operation.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/block/SimpleBlockModel.java