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

		// First check out the Block cache
		Object blocks[] = foundBlockMap.getObjects(addr);
		if (blocks.length > 0) {
			CodeBlock block = (CodeBlock) blocks[0];
			Address[] entryPts = block.getStartAddresses();
			for (Address entryPt : entryPts) {
				if (block.getFirstStartAddress().equals(addr)) {
					return block;
				}
			}
		}

		if (addr.isExternalAddress()) {
			return includeExternals ? createSimpleExtBlock(addr) : null;
		}

		// handle instruction code block
		Instruction instr = listing.getInstructionAt(addr);
		if (instr != null) {
			// handle primary (top) entry point
			if (isBlockStart(instr)) {
				return getCodeBlockAt(instr, monitor);
			}

			// handle secondary entry point
			if (instr.getSymbols().length != 0) {
				return getFirstCodeBlockContaining(addr, monitor);
			}

			return null;
		}

		// handle data block
		Data data = listing.getDefinedDataAt(addr);
		if (data != null) {
			return createSimpleDataBlock(addr, data.getMaxAddress());
		}
		return null;
	}
Get the code/data block starting at this address.

@param addr
@param monitor task monitor which allows user to cancel operation.
@return null if there is no codeblock starting at the address
@throws CancelledException if the monitor cancels the operation.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/block/SimpleBlockModel.java