Class DebugInfoEntry
java.lang.Object
ghidra.app.util.bin.format.dwarf4.DebugInfoEntry
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
ConstructorsConstructorDescriptionDebugInfoEntry
(DWARFCompilationUnit unit, long offset, DWARFAbbreviation abbreviation) Creates an empty DIE. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChild
(DebugInfoEntry child) Add a child DIE to this DIE.boolean
Get the abbreviation of this DIE.Return a live list of the child DIE's.getChildren
(int childTag) Return a list of children that are of a specific DWARF type.long
Get the offset of this DIE from the beginning of the debug_info section.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
Check to see if this DIE has any child DIE's.int
hashCode()
boolean
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.toString()
-
Constructor Details
-
DebugInfoEntry
Creates an empty DIE. Used bystatic 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
Add a child DIE to this DIE.- Parameters:
child
- DIE of the child
-
getChildren
Return a live list of the child DIE's.- Returns:
- list of child DIE's
-
getChildren
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
Set the parent DIE of this DIE.- Parameters:
parent
- the parent DIE
-
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
-
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
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
-
getCompilationUnit
-
hashCode
public int hashCode() -
equals
-