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
ConstructorDescriptionDWARFAbbreviation
(int abbreviationCode, int tagId, boolean hasChildren, DWARFAttribute.AttrDef[] attributes) -
Method Summary
Modifier and TypeMethodDescriptionfindAttribute
(DWARFAttribute attributeId) Get the attribute with the given attribute key.int
Get the abbreviation code.getAttributeAt
(int index) Get the attribute at the given index.int
Return number of attribute values.Return a live list of the attributes.getTag()
Get the tag value.boolean
Checks to see if this abbreviation has any DIE children.static DWARFAbbreviation
read
(BinaryReader reader, DWARFProgram prog, TaskMonitor monitor) Reads aDWARFAbbreviation
from 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 aDWARFAbbreviation
from the stream.- Parameters:
reader
-BinaryReader
streamprog
-DWARFProgram
monitor
-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
-DWARFProgram
monitor
-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
-