Class DWARFAbbreviation

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

public class DWARFAbbreviation extends Object
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 Details

    • DWARFAbbreviation

      public DWARFAbbreviation(int abbreviationCode, int tagId, boolean hasChildren, DWARFAttributeId.AttrDef[] attributes)
  • Method Details

    • read NEW

      public static DWARFAbbreviation read(BinaryReader reader, DIEContainer dieContainer) throws IOException
      Reads a DWARFAbbreviation from the stream.
      Parameters:
      reader - BinaryReader stream
      dieContainer - DIEContainer
      Returns:
      DWARFAbbreviation, or null if the stream was at a end-of-list marker
      Throws:
      IOException - if error reading
    • readAbbreviations NEW

      public static Map<Integer,DWARFAbbreviation> readAbbreviations(BinaryReader reader, DIEContainer dieContainer) throws IOException
      Reads a list of DWARFAbbreviation, stopping when the end-of-list marker is encountered.
      Parameters:
      reader - BinaryReader .debug_abbr stream
      dieContainer - DIEContainer
      Returns:
      map of abbrCode -> abbr instance
      Throws:
      IOException - if error reading
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getAbbreviationCode

      public int getAbbreviationCode()
      Get the abbreviation code.
      Returns:
      the abbreviation code
    • getTag

      public DWARFTag getTag()
      Get the tag value.
      Returns:
      the tag value
    • getTagName

      public String getTagName()
    • hasChildren

      public boolean hasChildren()
      Checks to see if this abbreviation has any DIE children.
      Returns:
      true if this abbreviation has DIE children
    • getAttributes MODIFIED

      public DWARFAttributeId.AttrDef[] getAttributes()
      return type: ghidra.app.util.bin.format.dwarf.attribs.DWARFAttribute.AttrDef[] → ghidra.app.util.bin.format.dwarf.attribs.DWARFAttributeId.AttrDef[]
      -ghidra.app.util.bin.format.dwarf.attribs.DWARFAttribute.AttrDef[] getAttributes()
      +ghidra.app.util.bin.format.dwarf.attribs.DWARFAttributeId.AttrDef[] 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 MODIFIED

      public DWARFAttributeId.AttrDef getAttributeAt(int index)
      return type: AttrDef → AttrDef
      -ghidra.app.util.bin.format.dwarf.attribs.DWARFAttribute.AttrDef getAttributeAt(int index)
      +ghidra.app.util.bin.format.dwarf.attribs.DWARFAttributeId.AttrDef getAttributeAt(int index)
      Get the attribute at the given index.
      Parameters:
      index - index of the attribute
      Returns:
      attribute specification
    • findAttribute NEW

      public DWARFAttributeId.AttrDef findAttribute(DWARFAttributeId attributeId)
      Get the attribute with the given attribute key.
      Parameters:
      attributeId - attribute key
      Returns:
      attribute specification