Class DebugInfoEntry
- java.lang.Object
-
- ghidra.app.util.bin.format.dwarf4.DebugInfoEntry
-
public class DebugInfoEntry extends java.lang.ObjectA DWARF Debug Info Entry is a collection ofattributesin a hierarchical structure (seegetParent(),getChildren()).This class is a lower-level class and
DIEAggregateshould 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(DebugInfoEntry child)Add a child DIE to this DIE.booleanequals(java.lang.Object obj)DWARFAbbreviationgetAbbreviation()Get the abbreviation of this DIE.DWARFAttributeValue[]getAttributes()java.util.List<DebugInfoEntry>getChildren()Return a live list of the child DIE's.java.util.List<DebugInfoEntry>getChildren(int childTag)Return a list of children that are of a specific DWARF type.DWARFCompilationUnitgetCompilationUnit()longgetOffset()Get the offset of this DIE from the beginning of the debug_info section.DebugInfoEntrygetParent()Get the parent DIE of this DIE.intgetTag()Get the DWARFTag value of this DIE.booleanhasAttribute(int attribute)Check to see if this DIE has the given attribute key.booleanhasChildren()Check to see if this DIE has any child DIE's.inthashCode()booleanisTerminator()Check to see if the DIE is a terminator.static DebugInfoEntryread(BinaryReader reader, DWARFCompilationUnit unit, DWARFAttributeFactory attributeFactory)Read a DIE record.voidsetParent(DebugInfoEntry parent)Set the parent DIE of this DIE.java.lang.StringtoString()
-
-
-
Constructor Detail
-
DebugInfoEntry
public DebugInfoEntry(DWARFCompilationUnit unit, long offset, DWARFAbbreviation abbreviation)
Creates an empty DIE. Used bystatic read()and junit tests.- Parameters:
unit-offset-abbreviation-
-
-
Method Detail
-
read
public static DebugInfoEntry read(BinaryReader reader, DWARFCompilationUnit unit, DWARFAttributeFactory attributeFactory) throws java.io.IOException
Read a DIE record.- Parameters:
reader-unit-attributeFactory-- Returns:
- Throws:
java.io.IOException
-
addChild
public void addChild(DebugInfoEntry child)
Add a child DIE to this DIE.- Parameters:
child- DIE of the child
-
getChildren
public java.util.List<DebugInfoEntry> getChildren()
Return a live list of the child DIE's.- Returns:
- list of child DIE's
-
getChildren
public java.util.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 java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getCompilationUnit
public DWARFCompilationUnit getCompilationUnit()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-