Package ghidra.app.util.bin.format.dwarf.macro.entry

# Class DWARFMacroInfoEntry

java.lang.Object
ghidra.app.util.bin.format.dwarf.macro.entry.DWARFMacroInfoEntry

Direct Known Subclasses:
  `DWARFMacroDefine`, `DWARFMacroEndFile`, `DWARFMacroImport`, `DWARFMacroStartFile`

public class DWARFMacroInfoEntry extends Object
Represents a generic macro info entry, and can contain any macro entry element.

Specific macro entry classes are derived from this and provide getters to ease fetching values that are expected for that class. These classes are expected to implement a copy-ctor that accepts a DWARFMacroInfoEntry containing the raw data to be wrapped, and must be registered in `toSpecializedForm(DWARFMacroInfoEntry)` method's switch() statement.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected DWARFMacroHeader`
  `macroHeader`
  `protected DWARFMacroOpcode`
  `opcode`
  `protected DWARFAttributeValue[]`
  `operandValues`
  `protected int`
  `rawOpcode`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  ``
  `DWARFMacroInfoEntry(DWARFMacroOpcode opcode, int rawOpcode, DWARFAttributeValue[] operandValues, DWARFMacroHeader macroHeader)`
  `protected`
  `DWARFMacroInfoEntry(DWARFMacroOpcode opcode, DWARFMacroHeader macroHeader)`
  `protected`
  `DWARFMacroInfoEntry(DWARFMacroInfoEntry other)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getName()`
  `DWARFMacroOpcode`
  `getOpcode()`
  `<T extends DWARFAttributeValue>
  T`
  `getOperand(int index, Class<T> valueClass)`
  `protected DWARFAttributeDef<DWARFMacroOpcode>`
  `operandDef(int operandIndex)`
  `static DWARFMacroInfoEntry`
  `read(BinaryReader reader, DWARFMacroHeader macroHeader)`
  Reads a DWARF macro info entry from the stream.
  `static DWARFMacroInfoEntry`
  `toSpecializedForm(DWARFMacroInfoEntry genericEntry)`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### opcode

    protected DWARFMacroOpcode opcode

  - ### rawOpcode

    protected int rawOpcode

  - ### operandValues

    protected DWARFAttributeValue[] operandValues

  - ### macroHeader

    protected DWARFMacroHeader macroHeader

- ## Constructor Details

  - ### DWARFMacroInfoEntry

    protected DWARFMacroInfoEntry(DWARFMacroOpcode opcode, DWARFMacroHeader macroHeader)

  - ### DWARFMacroInfoEntry

    public DWARFMacroInfoEntry(DWARFMacroOpcode opcode, int rawOpcode, DWARFAttributeValue[] operandValues, DWARFMacroHeader macroHeader)

  - ### DWARFMacroInfoEntry

    protected DWARFMacroInfoEntry(DWARFMacroInfoEntry other)

- ## Method Details

  - ### read

    public static DWARFMacroInfoEntry read(BinaryReader reader, DWARFMacroHeader macroHeader) throws IOException
    Reads a DWARF macro info entry from the stream.
    Parameters:
      `reader` - `BinaryReader` stream
      `macroHeader` - the parent `DWARFMacroHeader`
    Returns:
      a `DWARFMacroInfoEntry`, or subclass if element is a known opcode, or `null` if the element was the end-of-list marker
    Throws:
      `IOException` - if error reading or unknown opcode

  - ### toSpecializedForm

    public static DWARFMacroInfoEntry toSpecializedForm(DWARFMacroInfoEntry genericEntry)

  - ### getOpcode

    public DWARFMacroOpcode getOpcode()

  - ### getName

    public String getName()

  - ### getOperand

    public <T extends DWARFAttributeValue> T getOperand(int index, Class<T> valueClass) throws IOException
    Throws:
      `IOException`

  - ### operandDef

    protected DWARFAttributeDef<DWARFMacroOpcode> operandDef(int operandIndex)

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`