private DWARFLocationList readLocationList(DWARFNumericAttribute loclistAttr,
			DWARFCompilationUnit cu) throws IOException {
		try {
			switch (loclistAttr.getAttributeForm()) {
				case DW_FORM_sec_offset:
				case DW_FORM_data2:
				case DW_FORM_data4:
				case DW_FORM_data8:
					int dwarfVer = cu.getDWARFVersion();
					if (dwarfVer < 5) {
						debugLocation.setPointerIndex(loclistAttr.getUnsignedValue());
						return DWARFLocationList.readV4(debugLocation, cu);
					}
					else if (dwarfVer == 5) {
						debugLocLists.setPointerIndex(loclistAttr.getUnsignedValue());
						return DWARFLocationList.readV5(debugLocLists, cu);
					}
					break;
				case DW_FORM_loclistx:
					int index = loclistAttr.getUnsignedIntExact();
					long locOffset = locationListTable.getOffset(index, cu);
					debugLocLists.setPointerIndex(locOffset);
					return DWARFLocationList.readV5(debugLocLists, cu);
				default:
					break; // fallthru to throw
			}
		}
		catch (IOException | IllegalArgumentException e) {
			throw new IOException(
				"Failed to read location list specified by %s".formatted(loclistAttr.toString()),
				e);
		}
		throw new IOException(
			"Unsupported loclist form %s".formatted(loclistAttr.getAttributeForm()));
	}
Returns the {@link DWARFLocationList} pointed to by the specified attribute value.

@param diea {@link DIEAggregate}
@param attribute attribute id that points to the location list
@return {@link DWARFLocationList}, never null
@throws IOException if specified attribute is not the correct type, or if other error reading
data
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf/DWARFProgram.java