Package ghidra.app.util.bin.format.dwarf4

# Class DebugInfoEntry

java.lang.Object
ghidra.app.util.bin.format.dwarf4.DebugInfoEntry

public class DebugInfoEntry extends Object
A DWARF Debug Info Entry is a collection of `attributes` in a hierarchical structure (see `getParent()`, `getChildren()`).

This class is a lower-level class and `DIEAggregate` should be used instead in most cases when examining information from the DWARF system.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DebugInfoEntry(DWARFCompilationUnit unit, long offset, DWARFAbbreviation abbreviation)`
  Creates an empty DIE.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addChild(DebugInfoEntry child)`
  Add a child DIE to this DIE.
  `boolean`
  `equals(Object obj)`
  `DWARFAbbreviation`
  `getAbbreviation()`
  Get the abbreviation of this DIE.
  `DWARFAttributeValue[]`
  `getAttributes()`
  `List<DebugInfoEntry>`
  `getChildren()`
  Return a live list of the child DIE's.
  `List<DebugInfoEntry>`
  `getChildren(int childTag)`
  Return a list of children that are of a specific DWARF type.
  `DWARFCompilationUnit`
  `getCompilationUnit()`
  `long`
  `getOffset()`
  Get the offset of this DIE from the beginning of the debug_info section.
  `DebugInfoEntry`
  `getParent()`
  Get the parent DIE of this DIE.
  `int`
  `getTag()`
  Get the DWARFTag value of this DIE.
  `boolean`
  `hasAttribute(int attribute)`
  Check to see if this DIE has the given attribute key.
  `boolean`
  `hasChildren()`
  Check to see if this DIE has any child DIE's.
  `int`
  `hashCode()`
  `boolean`
  `isTerminator()`
  Check to see if the DIE is a terminator.
  `static DebugInfoEntry`
  `read(BinaryReader reader, DWARFCompilationUnit unit, DWARFAttributeFactory attributeFactory)`
  Read a DIE record.
  `void`
  `setParent(DebugInfoEntry parent)`
  Set the parent DIE of this DIE.
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### DebugInfoEntry

    public DebugInfoEntry(DWARFCompilationUnit unit, long offset, DWARFAbbreviation abbreviation)
    Creates an empty DIE. Used by `static read()` and junit tests.

    Parameters:
      `unit` -
      `offset` -
      `abbreviation` -

- ## Method Details

  - ### read

    public static DebugInfoEntry read(BinaryReader reader, DWARFCompilationUnit unit, DWARFAttributeFactory attributeFactory) throws IOException
    Read a DIE record.
    Parameters:
      `reader` -
      `unit` -
      `attributeFactory` -
    Returns:
    Throws:
      `IOException`

  - ### addChild

    public void addChild(DebugInfoEntry child)
    Add a child DIE to this DIE.
    Parameters:
      `child` - DIE of the child

  - ### getChildren

    public List<DebugInfoEntry> getChildren()
    Return a live list of the child DIE's.
    Returns:
      list of child DIE's

  - ### getChildren

    public List<DebugInfoEntry> getChildren(int childTag)
    Return a list of children that are of a specific DWARF type.

    Parameters:
      `childTag` -
    Returns:

  - ### hasChildren

    public boolean hasChildren()
    Check to see if this DIE has any child DIE's.
    Returns:
      true if there are child DIE's and false otherwise

  - ### setParent

    public void setParent(DebugInfoEntry parent)
    Set the parent DIE of this DIE.
    Parameters:
      `parent` - the parent DIE

  - ### getParent

    public DebugInfoEntry getParent()
    Get the parent DIE of this DIE.
    Returns:
      the parent DIE

  - ### getOffset

    public long getOffset()
    Get the offset of this DIE from the beginning of the debug_info section.
    Returns:
      the offset of this DIE from the beginning of the debug_info section

  - ### getTag

    public int getTag()
    Get the DWARFTag value of this DIE.
    Returns:
      the DWARFTag value of this DIE

  - ### getAttributes

    public DWARFAttributeValue[] getAttributes()

  - ### hasAttribute

    public boolean hasAttribute(int attribute)
    Check to see if this DIE has the given attribute key.
    Parameters:
      `attribute` - the attribute key
    Returns:
      true if the DIE contains the attribute and false otherwise

  - ### getAbbreviation

    public DWARFAbbreviation getAbbreviation()
    Get the abbreviation of this DIE.
    Returns:
      the abbreviation of this DIE

  - ### isTerminator

    public boolean isTerminator()
    Check to see if the DIE is a terminator.
    Returns:
      true if the DIE is a terminator and false otherwise

  - ### toString

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

  - ### getCompilationUnit

    public DWARFCompilationUnit getCompilationUnit()

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

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