public AddressRange getAddressRangeContaining(Address addr) {

		if (lastRange != null && lastRange.contains(addr)) {
			return new AddressRangeImpl(lastRange.getStart(), lastRange.getEnd());
		}

		Address min = addr.getAddressSpace().getMinAddress();
		Address max = addr.getAddressSpace().getMaxAddress();

		int pos = getPositionOfRangeAtOrBefore(new AddressValueRange<T>(addr, addr, null));
		if (pos >= 0) {
			lastRange = ranges.get(pos);
			if (lastRange.getEnd().compareTo(addr) >= 0) {
				return new AddressRangeImpl(lastRange.getStart(), lastRange.getEnd());
			}
			if (min.getAddressSpace().equals(lastRange.getEnd().getAddressSpace())) {
				min = lastRange.getEnd().next();
			}
		}
		if (++pos < ranges.size()) {
			lastRange = ranges.get(pos);
			if (lastRange.getStart().compareTo(addr) == 0) {
				return new AddressRangeImpl(lastRange.getStart(), lastRange.getEnd());
			}
			if (max.getAddressSpace().equals(lastRange.getStart().getAddressSpace())) {
				max = lastRange.getStart().previous();
			}
		}
		return new AddressRangeImpl(min, max);
	}
Get the value or hole range containing the specified address
@param addr
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/register/AddressRangeObjectMap.java