private AddressSet getAddressSetForCodeUnitAt(Program program, Address fromAddr) {
		AddressSet set = new AddressSet();
		CodeUnit codeUnit = program.getListing().getCodeUnitContaining(fromAddr);
		if (codeUnit == null) {
			set.addRange(fromAddr, fromAddr);
		}
		else {
			set.addRange(codeUnit.getMinAddress(), codeUnit.getMaxAddress());
		}
		return set;
	}
find possible references to current address
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/FindPossibleReferencesPlugin.java