public DWARFDataType getDataType(DIEAggregate diea, DWARFDataType defaultValue)
			throws IOException, DWARFExpressionException {

		if (diea == null) {
			return defaultValue;
		}

		// First try to find a datatype that has already been constructed for this DIEA and return
		// that if available.
		// Current impl (ie. not committed yet, this session only) datatypes are registered by offset->DDT.
		DWARFDataType result = dieOffsetToDataTypeMap.get(diea.getOffset());
		if (result != null) {
			return result;
		}

		// Query the dwarfDTM for plain Ghidra dataTypes that were previously
		// registered in a different import session.
		DataType alreadyImportedDT = dwarfDTM.getDataType(diea.getOffset(), null);
		if (shouldReuseAlreadyImportedDT(alreadyImportedDT)) {
			return new DWARFDataType(alreadyImportedDT, null, diea.getOffset());
		}

		if (!trackRecursion(diea.getOffset(), 1)) {
			return defaultValue;
		}

		// Fall back to creating a new Ghidra DataType from the info in the DIEA.
		switch (diea.getTag()) {
			case DW_TAG_pointer_type:
			case DW_TAG_reference_type:
			case DW_TAG_rvalue_reference_type:
				result = makeDataTypeForPointer(diea);
				break;
			case DW_TAG_ptr_to_member_type:
				result = makeDataTypeForPtrToMemberType(diea);
				break;
			case DW_TAG_base_type:
				result = makeDataTypeForBaseType(diea);
				break;
			case DW_TAG_typedef:
				result = makeDataTypeForTypedef(diea);
				break;
			case DW_TAG_unspecified_type:
				result = makeDataTypeForUnspecifiedType(diea);
				break;
			case DW_TAG_const_type:
			case DW_TAG_volatile_type:
			case DW_TAG_restrict_type:
			case DW_TAG_shared_type:
			case DW_TAG_APPLE_ptrauth_type:
			case DW_TAG_atomic_type:
				result = makeDataTypeForConst(diea);
				break;
			case DW_TAG_enumeration_type:
				result = makeDataTypeForEnum(diea);
				break;
			case DW_TAG_array_type:
				result = makeDataTypeForArray(diea);
				break;
			case DW_TAG_structure_type:
			case DW_TAG_class_type:
			case DW_TAG_union_type:
				result = makeDataTypeForStruct(diea);

				// push partial datatype info into currentTypes mapping to handle
				// recursion issues.
				recordTempDataType(result);

				finishStruct(diea, result);
				break;

			case DW_TAG_subroutine_type:
				result = makeDataTypeForFunctionDefinition(diea);
				break;
			default:
				Msg.warn(this, "Unsupported datatype in die: " + diea.toString());
		}
		trackRecursion(diea.getOffset(), -1);

		if (result == null) {
			return defaultValue;
		}

		if (result.dsi == null) {
			result.dsi = DWARFSourceInfo.create(diea);
		}

		// store mapping info for this datatype for this session
		recordTempDataType(result);

		return result;
	}
Converts the specified DWARF debug entry into a Ghidra {@link DataType} (wrapped
in a simple holder object to also return associated metadata).

@param diea DWARF {@link DIEAggregate} to convert into Ghidra DataType.
@param defaultValue value to return if the specified DIEA is null or there is a problem
with the DWARF debug data.
@return a {@link DWARFDataType} wrapper around the new Ghidra {@link DataType}.
@throws IOException
@throws DWARFExpressionException
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf/DWARFDataTypeImporter.java