Class DWARFRegisterMappingsManager
- java.lang.Object
-
- ghidra.app.util.bin.format.dwarf4.next.DWARFRegisterMappingsManager
-
public class DWARFRegisterMappingsManager extends java.lang.ObjectFactory class to instantiate and cacheDWARFRegisterMappingsobjects.
-
-
Constructor Summary
Constructors Constructor Description DWARFRegisterMappingsManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ResourceFilegetDWARFRegisterMappingFileFor(Language lang)ReturnsResourceFilethat should contain the specified language's DWARF register mapping, never null.static DWARFRegisterMappingsgetMappingForLang(Language lang)Returns a possibly cachedDWARFRegisterMappingsobject for the specified language,static booleanhasDWARFRegisterMapping(Language lang)Returns true if the specifiedLanguagehas DWARF register mappings.static booleanhasDWARFRegisterMapping(LanguageDescription langDesc)Returns true if the specifiedLanguageDescriptionhas DWARF register mappings.static DWARFRegisterMappingsreadMappingForLang(Language lang)Finds the DWARF register mapping information file specified in the specified language's LDEF file and returns a newDWARFRegisterMappingsobject containing the data read from that file.static DWARFRegisterMappingsreadMappingFrom(org.jdom.Element rootElem, Language lang)Creates a newDWARFRegisterMappingsfrom the data present in the xml element.
-
-
-
Method Detail
-
hasDWARFRegisterMapping
public static boolean hasDWARFRegisterMapping(LanguageDescription langDesc) throws java.io.IOException
Returns true if the specifiedLanguageDescriptionhas DWARF register mappings.- Parameters:
langDesc- TheLanguageDescriptionto 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 specifiedLanguagehas DWARF register mappings.- Parameters:
lang- TheLanguageto 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.
-
getMappingForLang
public static DWARFRegisterMappings getMappingForLang(Language lang) throws java.io.IOException
Returns a possibly cachedDWARFRegisterMappingsobject for the specified language,- Parameters:
lang-Languageto get the matching DWARF register mappings for- Returns:
DWARFRegisterMappingsinstance, never null- Throws:
java.io.IOException- if mapping not found or invalid
-
getDWARFRegisterMappingFileFor
public static ResourceFile getDWARFRegisterMappingFileFor(Language lang) throws java.io.IOException
ReturnsResourceFilethat should contain the specified language's DWARF register mapping, never null.- Parameters:
lang-Languageto find the mapping file for.- Returns:
ResourceFileof 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 newDWARFRegisterMappingsobject containing the data read from that file.Throws
IOExceptionif the lang does not have a mapping or it is invalid.- Parameters:
lang-Languageto read the matching DWARF register mappings for- Returns:
- a new
DWARFRegisterMappingsinstance, created from information read from theDWARF_REGISTER_MAPPING_NAMExml file referenced in the language's LDEF, never null. - Throws:
java.io.IOException- if there is no DWARF register mapping file associated with the specifiedLanguageor 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 newDWARFRegisterMappingsfrom the data present in the xml element.- Parameters:
rootElem- JDom XML element containing the <dwarf> root element of the mapping file.lang- The GhidraLanguagethat the DWARF register mapping applies to- Returns:
- a new
DWARFRegisterMappingsinstance, never null. - Throws:
java.io.IOException- if missing or invalid data found in xml
-
-