public Data getFirstUndefinedDataBefore(Address addr, TaskMonitor monitor) {
		if (!addr.isMemoryAddress() || addr.getOffset() == 0) {
			return null;
		}
		Memory mem = program.getMemory();
		AddressSetView set =
			mem.intersectRange(addr.getAddressSpace().getMinAddress(), addr.previous());

		int i = 0;
		CodeUnitIterator it = getCodeUnits(set, false);
		while (it.hasNext()) {
			CodeUnit cu = it.next();
			if (cu instanceof Data && !((Data) cu).isDefined()) {
				return (Data) cu;
			}
			if (++i % 1000 == 0) {
				monitor.setMessage("Searching address " + cu.getMinAddress());
			}
		}
		return null;
	}
Returns the next undefined data whose min address is closest to and less than the specified 
address.

@param addr the address to look before
@param monitor the task monitor
@return the undefined data before the address, null if a undefined data does not exist
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/code/CodeManager.java