Package ghidra.app.util.bin.format.dwarf

# Class DWARFRegisterMappingsManager

java.lang.Object
ghidra.app.util.bin.format.dwarf.DWARFRegisterMappingsManager

public class DWARFRegisterMappingsManager extends Object
Factory class to instantiate and cache `DWARFRegisterMappings` objects.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DWARFRegisterMappingsManager()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static DWARFRegisterMappings`
  `getMappingForLang(Language lang)`
  Returns a possibly cached `DWARFRegisterMappings` object for the specified language,
  `static boolean`
  `hasDWARFRegisterMapping(Language lang)`
  Returns true if the specified `Language` has DWARF register mappings.
  `static DWARFRegisterMappings`
  `readMappingForLang(Language lang)`
  Finds the DWARF register mapping information file specified in the specified language's LDEF file and returns a new `DWARFRegisterMappings` object containing the data read from that file.
  `static DWARFRegisterMappings`
  `readMappingFrom(org.jdom.Element rootElem, Language lang)`
  Creates a new `DWARFRegisterMappings` from the data present in the xml element.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DWARFRegisterMappingsManager

    public DWARFRegisterMappingsManager()

- ## Method Details

  - ### hasDWARFRegisterMapping

    public static boolean hasDWARFRegisterMapping(Language lang) throws IOException
    Returns true if the specified `Language` has DWARF register mappings.
    Parameters:
      `lang` - The `Language` to test
    Returns:
      true if the language has a DWARF register mapping specified
    Throws:
      `IOException` - if there was an error in the language LDEF file.

  - ### getMappingForLang

    public static DWARFRegisterMappings getMappingForLang(Language lang) throws IOException
    Returns a possibly cached `DWARFRegisterMappings` object for the specified language,
    Parameters:
      `lang` - `Language` to get the matching DWARF register mappings for
    Returns:
      `DWARFRegisterMappings` instance, never null
    Throws:
      `IOException` - if mapping not found or invalid

  - ### readMappingForLang

    public static DWARFRegisterMappings readMappingForLang(Language lang) throws IOException
    Finds the DWARF register mapping information file specified in the specified language's LDEF file and returns a new `DWARFRegisterMappings` object containing the data read from that file.

    Throws `IOException` if the lang does not have a mapping or it is invalid.

    Parameters:
      `lang` - `Language` to read the matching DWARF register mappings for
    Returns:
      a new `DWARFRegisterMappings` instance, created from information read from the `DWARF_REGISTER_MAPPING_NAME` xml file referenced in the language's LDEF, never null.
    Throws:
      `IOException` - if there is no DWARF register mapping file associated with the specified `Language` or if there was an error in the register mapping data.

  - ### readMappingFrom

    public static DWARFRegisterMappings readMappingFrom(org.jdom.Element rootElem, Language lang) throws IOException
    Creates a new `DWARFRegisterMappings` from the data present in the xml element.
    Parameters:
      `rootElem` - JDom XML element containing the <dwarf> root element of the mapping file.
      `lang` - The Ghidra `Language` that the DWARF register mapping applies to
    Returns:
      a new `DWARFRegisterMappings` instance, never null.
    Throws:
      `IOException` - if missing or invalid data found in xml