public static DWARFRegisterMappings readMappingFrom(Element rootElem, Language lang)
			throws IOException {

		Element regMappingsElem = rootElem.getChild("register_mappings");
		if (regMappingsElem == null) {
			throw new IOException("Missing required DWARF <register_mappings> element");
		}

		Map<Integer, Register> regmap = new HashMap<>();
		int spi;
		long cfa;
		boolean useFPS;
		try {
			spi = readMappingsElem(regMappingsElem, lang, regmap);
			Element callFrameElem = rootElem.getChild("call_frame_cfa");
			cfa = (callFrameElem != null)
					? XmlUtilities.parseOptionalBoundedLongAttr(callFrameElem, "value", 0, 0,
						Long.MAX_VALUE)
					: 0;

			Element useFormalParameterStorageElem =
				rootElem.getChild("use_formal_parameter_storage");
			useFPS = (useFormalParameterStorageElem != null);
		}
		catch (NumberFormatException nfe) {
			throw new IOException("Failed to parse DWARF register mappings: " + nfe.getMessage(),
				nfe);
		}

		return new DWARFRegisterMappings(regmap, cfa, spi, useFPS);
	}
Creates a new {@link DWARFRegisterMappings} from the data present in the
xml element.

@param rootElem JDom XML element containing the &lt;dwarf&gt; root
           element of the mapping file.
@param lang The Ghidra {@link Language} that the DWARF register mapping
           applies to
@return a new {@link DWARFRegisterMappings} instance, never null.
@throws IOException if missing or invalid data found in xml
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf/DWARFRegisterMappingsManager.java