Class DWARFAttributeDef<E extends Enum<E>>

java.lang.Object
ghidra.app.util.bin.format.dwarf.attribs.DWARFAttributeDef<E>
Type Parameters:
E - attribute id enum type
Direct Known Subclasses:
DWARFAttribute.AttrDef, DWARFLineContentType.Def

public class DWARFAttributeDef<E extends Enum<E>> extends Object
Information about a single DWARF attribute, as specified in a abbreviation.

This class handles the case where a specified attribute id is unknown to us (therefore not listed in the attribute enum class), as well as the case where the form is customized with an implicitValue.

Unknown forms are not supported and cause an exception.

  • Field Details Link icon

    • attributeId Link icon

      protected final E extends Enum<E> attributeId
    • attributeForm Link icon

      protected final DWARFForm attributeForm
    • rawAttributeId Link icon

      protected final int rawAttributeId
    • implicitValue Link icon

      protected final long implicitValue
  • Constructor Details Link icon

    • DWARFAttributeDef Link icon

      public DWARFAttributeDef(E attributeId, int rawAttributeId, DWARFForm attributeForm, long implicitValue)
  • Method Details Link icon

    • read Link icon

      public static <E extends Enum<E>> DWARFAttributeDef<E> read(BinaryReader reader, Function<Integer,E> mapper) throws IOException
      Reads a DWARFAttributeDef instance from the reader.

      Returns a null if its a end-of-list marker (which is only used by an attributespec list).

      Type Parameters:
      E - attribute id enum type
      Parameters:
      reader - BinaryReader
      mapper - func that converts an attribute id int into its enum
      Returns:
      DWARFAttributeDef instance, or null if EOL marker was read from the stream
      Throws:
      IOException - if error reading
    • getAttributeId Link icon

      public E getAttributeId()
      Get the attribute id of the attribute specification.
      Returns:
      the attribute value
    • getRawAttributeId Link icon

      public int getRawAttributeId()
    • getAttributeName Link icon

      public String getAttributeName()
    • getRawAttributeIdDescription Link icon

      protected String getRawAttributeIdDescription()
    • getAttributeForm Link icon

      public DWARFForm getAttributeForm()
      Get the form of the attribute specification.
      Returns:
      the form value
    • isImplicit Link icon

      public boolean isImplicit()
    • getImplicitValue Link icon

      public long getImplicitValue()
    • withForm Link icon

      public DWARFAttributeDef<E> withForm(DWARFForm newForm)
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals Link icon

      public boolean equals(Object obj)
      Overrides:
      equals in class Object