Class DWARFRegisterMappingsManager


  • public class DWARFRegisterMappingsManager
    extends java.lang.Object
    Factory class to instantiate and cache DWARFRegisterMappings objects.

    • Constructor Detail

      • DWARFRegisterMappingsManager

        public DWARFRegisterMappingsManager()
    • Method Detail

      • hasDWARFRegisterMapping

        public static boolean hasDWARFRegisterMapping​(LanguageDescription langDesc)
                                               throws java.io.IOException
        Returns true if the specified LanguageDescription has DWARF register mappings.
        Parameters:
        langDesc - The LanguageDescription to test
        Returns:
        true if the language has a DWARF register mapping specified
        Throws:
        java.io.IOException - if there was an error in the language LDEF file.
      • hasDWARFRegisterMapping

        public static boolean hasDWARFRegisterMapping​(Language lang)
                                               throws java.io.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:
        java.io.IOException - if there was an error in the language LDEF file.
      • getDWARFRegisterMappingFileFor

        public static ResourceFile getDWARFRegisterMappingFileFor​(Language lang)
                                                           throws java.io.IOException
        Returns ResourceFile that should contain the specified language's DWARF register mapping, never null.
        Parameters:
        lang - Language to find the mapping file for.
        Returns:
        ResourceFile of where the mapping file should be, never null.
        Throws:
        java.io.IOException - if not a Sleigh language or no mapping specified or multiple mappings specified.
      • readMappingForLang

        public static DWARFRegisterMappings readMappingForLang​(Language lang)
                                                        throws java.io.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:
        java.io.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 java.io.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:
        java.io.IOException - if missing or invalid data found in xml