public static DebugInfoEntry read(BinaryReader reader, DWARFCompilationUnit cu, int dieIndex)
			throws IOException {
		long offset = reader.getPointerIndex();
		int ac = reader.readNextUnsignedVarIntExact(LEB128::unsigned);

		// Check for terminator DIE
		if (ac == 0) {
			return new DebugInfoEntry(cu, offset);
		}

		DWARFAbbreviation abbreviation = cu.getAbbreviation(ac);
		if (abbreviation == null) {
			throw new IOException("Abbreviation code %d not found in compunit %d at 0x%x"
					.formatted(ac, cu.getUnitNumber(), cu.getStartOffset()));
		}
		int[] attrOffsets = new int[abbreviation.getAttributeCount()];

		// Read in all of the attribute values based on the attribute specification
		AttrDef[] attributeSpecs = abbreviation.getAttributes();
		int currentAttrOffset = (int) (reader.getPointerIndex() - offset);
		for (int i = 0; i < attributeSpecs.length; i++) {
			attrOffsets[i] = currentAttrOffset;

			AttrDef attributeSpec = attributeSpecs[i];
			DWARFFormContext context = new DWARFFormContext(reader, cu, attributeSpec);
			long attrSize = attributeSpec.getAttributeForm().getSize(context);
			if (attrSize < 0 || attrSize > Integer.MAX_VALUE) {
				throw new IOException("Invalid attribute value size");
			}

			currentAttrOffset += attrSize;

			// manually set stream position because some attributes don't read from the stream to determine size
			reader.setPointerIndex(offset + currentAttrOffset);
		}

		return new DebugInfoEntry(cu, offset, dieIndex, abbreviation, attrOffsets);
	}
Read a DIE record.

@param reader {@link BinaryReader} positioned at the start of a DIE record
@param cu the compunit that contains the DIE
@param dieIndex the index of the DIE
@return new DIE instance
@throws IOException if error reading data, or bad DWARF
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf/DebugInfoEntry.java