private void encodeFunction(Encoder encoder, Function func, Address addr,
			boolean includeDefaultNames) throws IOException {
		Address entry = func.getEntryPoint();
		if (entry.getAddressSpace().equals(addr.getAddressSpace())) {
			long diff = addr.getOffset() - entry.getOffset();
			if ((diff >= 0) && (diff < 8)) {
				HighFunction hfunc =
					new HighFunction(func, pcodelanguage, pcodecompilerspec, dtmanage);

				int extrapop = getExtraPopOverride(func, addr);
				hfunc.grabFromFunction(extrapop, includeDefaultNames,
					(extrapop != default_extrapop));

				HighSymbol functionSymbol = new HighFunctionSymbol(entry, (int) (diff + 1), hfunc);
				Namespace namespc = functionSymbol.getNamespace();
				if (debug != null) {
					debug.getFNTypes(hfunc);
					debug.addPossiblePrototypeExtension(func);
				}
				encodeResult(encoder, functionSymbol, namespc);
				return;
			}
		}

		AddressRangeIterator iter = func.getBody().getAddressRanges();
		while (iter.hasNext()) {
			AddressRange range = iter.next();
			if (range.contains(addr)) {
				Address first = range.getMinAddress();
				Address last = range.getMaxAddress();
				encodeHole(encoder, first.getAddressSpace(), first.getUnsignedOffset(),
					last.getUnsignedOffset(), MutabilitySettingsDefinition.CONSTANT);
				return;
			}
		}
		// There is probably some sort of error, just return a block
		// containing the single queried address
		encodeHole(encoder, addr.getAddressSpace(), addr.getUnsignedOffset(),
			addr.getUnsignedOffset(), MutabilitySettingsDefinition.CONSTANT);
	}
This function deals with the vagaries of the getMappedSymbols
interface when the queried address is in the body of a function.
Basically, if the address is the entry point of the function, all the
function data is sent. Otherwise a hole is sent back of the biggest
contiguous block in the body of the function containing the queried
address

@param encoder is the stream encoder
@param func Function whose body contains the address
@param addr The queried address
@param includeDefaultNames true if default parameter names should be
           included
@throws IOException for errors in the underlying stream
Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/DecompileCallback.java