class DIE

Declaration

class DIE { /* full declaration omitted */ };

Description

A DWARF debug information entry class used to generate DWARF DIEs. This class is used to quickly generate DWARF debug information by creating child DIEs or adding attributes to the current DIE. Instances of this class are created from the compile unit (dwarfgen::CompileUnit::getUnitDIE()) or by calling dwarfgen::DIE::addChild(...) and using the returned DIE object.

Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:57

Method Overview

  • protected DIE(llvm::dwarfgen::CompileUnit * U = nullptr, llvm::DIE * D = nullptr)
  • public void addAttribute(uint16_t Attr, dwarf::Form Form)
  • public void addAttribute(uint16_t Attr, dwarf::Form Form, uint64_t U)
  • public void addAttribute(uint16_t Attr, dwarf::Form Form, const llvm::MCExpr & Expr)
  • public void addAttribute(uint16_t Attr, dwarf::Form Form, llvm::StringRef String)
  • public void addAttribute(uint16_t Attr, dwarf::Form Form, dwarfgen::DIE & RefDie)
  • public void addAttribute(uint16_t Attr, dwarf::Form Form, const void * P, size_t S)
  • public dwarfgen::DIE addChild(dwarf::Tag Tag)
  • public void addStrOffsetsBaseAttribute()
  • protected unsigned int computeSizeAndOffsets(unsigned int CUOffset)

Methods

DIE(llvm::dwarfgen::CompileUnit* U = nullptr,
    llvm::DIE* D = nullptr)

Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:65

Parameters

llvm::dwarfgen::CompileUnit* U = nullptr
llvm::DIE* D = nullptr

void addAttribute(uint16_t Attr, dwarf::Form Form)

Description

Add an attribute value that has no value.

Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:81

Parameters

uint16_t Attr
a dwarf::Attribute enumeration value or any uint16_t that represents a user defined DWARF attribute.
dwarf::Form Form
the dwarf::Form to use when encoding the attribute. This is only used with the DW_FORM_flag_present form encoding.

void addAttribute(uint16_t Attr,
                  dwarf::Form Form,
                  uint64_t U)

Description

Add an attribute value to be encoded as a DIEInteger

Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:89

Parameters

uint16_t Attr
a dwarf::Attribute enumeration value or any uint16_t that represents a user defined DWARF attribute.
dwarf::Form Form
the dwarf::Form to use when encoding the attribute.
uint64_t U
the unsigned integer to encode.

void addAttribute(uint16_t Attr,
                  dwarf::Form Form,
                  const llvm::MCExpr& Expr)

Description

Add an attribute value to be encoded as a DIEExpr

Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:97

Parameters

uint16_t Attr
a dwarf::Attribute enumeration value or any uint16_t that represents a user defined DWARF attribute.
dwarf::Form Form
the dwarf::Form to use when encoding the attribute.
const llvm::MCExpr& Expr
the MC expression used to compute the value.

void addAttribute(uint16_t Attr,
                  dwarf::Form Form,
                  llvm::StringRef String)

Description

Add an attribute value to be encoded as a DIEString or DIEInlinedString.

Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:106

Parameters

uint16_t Attr
a dwarf::Attribute enumeration value or any uint16_t that represents a user defined DWARF attribute.
dwarf::Form Form
the dwarf::Form to use when encoding the attribute. The form must be one of DW_FORM_strp or DW_FORM_string.
llvm::StringRef String
the string to encode.

void addAttribute(uint16_t Attr,
                  dwarf::Form Form,
                  dwarfgen::DIE& RefDie)

Description

Add an attribute value to be encoded as a DIEEntry. DIEEntry attributes refer to other llvm::DIE objects that have been created.

Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:118

Parameters

uint16_t Attr
a dwarf::Attribute enumeration value or any uint16_t that represents a user defined DWARF attribute.
dwarf::Form Form
the dwarf::Form to use when encoding the attribute. The form must be one of DW_FORM_strp or DW_FORM_string.
dwarfgen::DIE& RefDie
the DIE that this attriute refers to.

void addAttribute(uint16_t Attr,
                  dwarf::Form Form,
                  const void* P,
                  size_t S)

Description

Add an attribute value to be encoded as a DIEBlock. DIEBlock attributes refers to binary data that is stored as the attribute's value.

Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:131

Parameters

uint16_t Attr
a dwarf::Attribute enumeration value or any uint16_t that represents a user defined DWARF attribute.
dwarf::Form Form
the dwarf::Form to use when encoding the attribute. The form must be one of DW_FORM_strp or DW_FORM_string.
const void* P
a pointer to the data to store as the attribute value.
size_t S
the size in bytes of the data pointed to by P .

dwarfgen::DIE addChild(dwarf::Tag Tag)

Description

Add a new child to this DIE object.

Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:141

Parameters

dwarf::Tag Tag
the dwarf::Tag to assing to the llvm::DIE object.

Returns

the newly created DIE object that is now a child owned by this object.

void addStrOffsetsBaseAttribute()

Description

Add a DW_AT_str_offsets_base attribute to this DIE.

Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:134

unsigned int computeSizeAndOffsets(
    unsigned int CUOffset)

Description

Called with a compile/type unit relative offset prior to generating the DWARF debug info.

Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:72

Parameters

unsigned int CUOffset
the compile/type unit relative offset where the abbreviation code for this DIE will be encoded.