Package ghidra.app.util.bin.format.dwarf
Class DWARFAbbreviation
java.lang.Object
ghidra.app.util.bin.format.dwarf.DWARFAbbreviation
This class represents the 'schema' for a DWARF DIE record.
A raw DWARF DIE record specifies its abbreviation code (pointing to an instance of this class) and the corresponding DWARFAbbreviation instance has the information about how the raw DIE is laid out.
-
Constructor Summary
ConstructorsConstructorDescriptionDWARFAbbreviation(int abbreviationCode, int tagId, boolean hasChildren, DWARFAttribute.AttrDef[] attributes) -
Method Summary
Modifier and TypeMethodDescriptionfindAttribute(DWARFAttribute attributeId) Get the attribute with the given attribute key.intGet the abbreviation code.getAttributeAt(int index) Get the attribute at the given index.intReturn number of attribute values.Return a live list of the attributes.getTag()Get the tag value.booleanChecks to see if this abbreviation has any DIE children.static DWARFAbbreviationread(BinaryReader reader, DWARFProgram prog, TaskMonitor monitor) Reads aDWARFAbbreviationfrom the stream.static Map<Integer, DWARFAbbreviation> readAbbreviations(BinaryReader reader, DWARFProgram prog, TaskMonitor monitor) Reads a list ofDWARFAbbreviation, stopping when the end-of-list marker is encountered.toString()
-
Constructor Details
-
DWARFAbbreviation
public DWARFAbbreviation(int abbreviationCode, int tagId, boolean hasChildren, DWARFAttribute.AttrDef[] attributes)
-
-
Method Details
-
read
public static DWARFAbbreviation read(BinaryReader reader, DWARFProgram prog, TaskMonitor monitor) throws IOException, CancelledException Reads aDWARFAbbreviationfrom the stream.- Parameters:
reader-BinaryReaderstreamprog-DWARFProgrammonitor-TaskMonitor- Returns:
DWARFAbbreviation, or null if the stream was at a end-of-list marker- Throws:
IOException- if error readingCancelledException- if canceled
-
readAbbreviations
public static Map<Integer,DWARFAbbreviation> readAbbreviations(BinaryReader reader, DWARFProgram prog, TaskMonitor monitor) throws IOException, CancelledException Reads a list ofDWARFAbbreviation, stopping when the end-of-list marker is encountered.- Parameters:
reader-BinaryReader.debug_abbr streamprog-DWARFProgrammonitor-TaskMonitor- Returns:
- map of abbrCode -> abbr instance
- Throws:
IOException- if error readingCancelledException- if cancelled
-
toString
-
getAbbreviationCode
public int getAbbreviationCode()Get the abbreviation code.- Returns:
- the abbreviation code
-
getTag
Get the tag value.- Returns:
- the tag value
-
getTagName
-
hasChildren
public boolean hasChildren()Checks to see if this abbreviation has any DIE children.- Returns:
- true if this abbreviation has DIE children
-
getAttributes
Return a live list of the attributes.- Returns:
- list of attributes
-
getAttributeCount
public int getAttributeCount()Return number of attribute values.- Returns:
- number of attribute values
-
getAttributeAt
Get the attribute at the given index.- Parameters:
index- index of the attribute- Returns:
- attribute specification
-
findAttribute
Get the attribute with the given attribute key.- Parameters:
attributeId- attribute key- Returns:
- attribute specification
-