Class DebugInfoEntry
- java.lang.Object
-
- ghidra.app.util.bin.format.dwarf4.DebugInfoEntry
-
public class DebugInfoEntry extends java.lang.Object
A DWARF Debug Info Entry is a collection ofattributes
in a hierarchical structure (seegetParent()
,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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(DebugInfoEntry child)
Add a child DIE to this DIE.boolean
equals(java.lang.Object obj)
DWARFAbbreviation
getAbbreviation()
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.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.java.lang.String
toString()
-
-
-
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:
toString
in classjava.lang.Object
-
getCompilationUnit
public DWARFCompilationUnit getCompilationUnit()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-