private static String getDynamicDataName(Data data, Address address, int refLevel) {

		Address codeUnitAddress = data.getMinAddress();
		long diff = address.subtract(codeUnitAddress);

		boolean isString = data.hasStringValue();

		//
		// Data member
		//
		if (!isString) {
			int n = data.getNumComponents();
			if (n > 0 && diff > 0) { // only when there are children and there is an offcut
				Data data2 = data.getPrimitiveAt((int) diff);
				if (data2 == null) {
					data2 = data;
				}
				long datOffset = address.subtract(data2.getMinAddress());
				return (datOffset == 0 ? data2.getPathName()
						: data2.getPathName() + PLUS + datOffset);
			}
		}

		//
		// Non-data member
		//
		Address normalizedAddress = normalizeSegmentedAddress(data, address);
		if (diff != 0) {
			return generateOffcutDataName(data, normalizedAddress, (int) diff, refLevel, isString);
		}

		String prefix = data.getDefaultLabelPrefix(DataTypeDisplayOptions.DEFAULT);
		if (prefix != null) {
			return prefix + UNDERSCORE + getAddressString(normalizedAddress);
		}

		//
		// no prefix given--use default dynamic name
		//
		return getDynamicName(refLevel, normalizedAddress);
	}
Create a name for a dynamic symbol.
@param program the current program
@param addr the address of the symbol for which to generate a name
@return a name for the symbol at the given address
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SymbolUtilities.java