llvm::DWARFDie

Utility class that carries the DWARF compile/type unit and the debug info entry in an object.

Synopsis

Declared in <llvm/DebugInfo/DWARF/DWARFDie.h>

class DWARFDie;

Description

When accessing information from a debug info entry we always need to DWARF compile/type unit in order to extract the info correctly as some information is relative to the compile/type unit. Prior to this class the DWARFUnit and the DWARFDebugInfoEntry was passed around separately and there was the possibility for error if the wrong DWARFUnit was used to extract a unit relative offset. This class helps to ensure that this doesn't happen and also simplifies the attribute extraction calls by not having to specify the DWARFUnit for each call.

Types

NameDescription
attribute_iterator Forward iterator over the attributes of a single DWARFDie.
iterator Bidirectional iterator over the immediate children of a DWARFDie.

Type Aliases

NameDescription
DWARFFormValue Alias for the DWARF form/value type used by attribute accessors.

Member Functions

NameDescription
DWARFDie [constructor]Constructors
addressRangeContainsAddress True if Address falls within this DIE's address ranges.
attributes Get an iterator range to all attributes in the current DIE only.
begin Iterator to the first child DIE of this DIE.
children Iterator range over this DIE's immediate children (excluding the null terminator).
dump dump overloads
end Past-the-end iterator over this DIE's children (the terminating null DIE).
find find overloads
findRecursively Extract the first value of any attribute in Attrs from this DIE and recurse into any DW_AT_specification or DW_AT_abstract_origin referenced DIEs.
getAbbreviationDeclarationPtr Get the abbreviation declaration for this DIE.
getAddressRanges Get the address ranges for this DIE.
getAttributeValueAsReferencedDie getAttributeValueAsReferencedDie overloads
getCallerFrame Fill call-site file, line, column, and discriminator from this DIE.
getDebugInfoEntry Return the underlying debug-info entry, or nullptr if invalid.
getDeclFile Declaration file path for this DIE (via DW_AT_decl_file), formatted per Kind.
getDeclLine Return the declaration line for a subprogram DIE.
getDwarfUnit Return the DWARF compile/type unit that owns this DIE, or nullptr.
getFirstChild Get the first child of this DIE object.
getFullName Append this DIE's unqualified type name to OS (optionally keep original spelling).
getHighPC Get the DW_AT_high_pc attribute value as an address.
getLanguage Returns the DW_LANG_ code for this DIE's DWARF unit, if it exists.
getLastChild Get the last child of this DIE object.
getLinkageName Return the DIE linkage name resolving DW_AT_specification or DW_AT_abstract_origin references if necessary. Returns null if no name is found.
getLocBaseAttribute Absolute section offset of DW_AT_loclists_base, if present on this DIE.
getLocations Return location expressions for attribute Attr (inline or from loclists).
getLowAndHighPC Retrieves DW_AT_low_pc and DW_AT_high_pc from CU.
getName Return the DIE name, resolving specification or abstract origin if needed.
getOffset Get the absolute offset into the debug info or types section.
getParent Get the parent of this DIE object.
getPreviousSibling Get the previous sibling of this DIE object.
getRangesBaseAttribute Extract the range base attribute from this DIE as absolute section offset.
getShortName Return the DIE short name resolving DW_AT_specification or DW_AT_abstract_origin references if necessary. Returns null if no name is found.
getSibling Get the sibling of this DIE object.
getSubroutineName Return the mangled or short name of a subprogram or inlined subroutine DIE.
getTag Return this DIE's DWARF tag, or DW_TAG_null for a null DIE.
getTypeSize Gets the type size (in bytes) for this DIE.
hasChildren True if this DIE has child DIEs.
isNULL Returns true for a valid DIE that terminates a sibling chain.
isSubprogramDIE Returns true if DIE represents a subprogram (not inlined).
isSubroutineDIE Returns true if DIE represents a subprogram or an inlined subroutine.
isValid True if this DIE is bound to both a unit and a debug-info entry.
rbegin Reverse iterator to the last child of this DIE.
rend Past-the-end reverse iterator over this DIE's children.
resolveReferencedType resolveReferencedType overloads
resolveTypeUnitReference Resolve this DIE's type-unit reference to the referenced type DIE.
operator bool True if this DIE refers to a valid unit and debug-info entry.

Non-Member Functions

NameDescription
dumpTypeQualifiedNameDump the qualified type name of DIE to OS.
dumpTypeUnqualifiedNameDump the unqualified type name of DIE to OS.
operator!=True if LHS and RHS refer to different units or debug-info entries.
operator<True if LHS's section offset is less than RHS's.
operator==True if LHS and RHS refer to the same unit and debug-info entry.