class Generator

Declaration

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

Description

A DWARF generator. Generate DWARF for unit tests by creating any instance of this class and calling Generator::addCompileUnit(), and then getting the dwarfgen::DIE from the returned compile unit and adding attributes and children to each DIE.

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

Method Overview

Methods

dwarfgen::CompileUnit& addCompileUnit()

Description

Add a compile unit to be generated.

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

Returns

a dwarfgen::CompileUnit that can be used to retrieve the compile unit dwarfgen::DIE that can be used to add attributes and add child DIE objects to.

llvm::dwarfgen::LineTable& addLineTable(
    dwarf::DwarfFormat DwarfFormat =
        dwarf::DwarfFormat::DWARF32)

Description

Add a line table unit to be generated.

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

Parameters

dwarf::DwarfFormat DwarfFormat = dwarf::DwarfFormat::DWARF32
the DWARF format to use (DWARF32 or DWARF64).

Returns

a dwarfgen::LineTable that can be used to customise the contents of the line table.

static llvm::Expected<std::unique_ptr<Generator>>
create(llvm::Triple TheTriple,
       uint16_t DwarfVersion)

Description

Create a DWARF generator or get an appropriate error.

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

Parameters

llvm::Triple TheTriple
the triple to use when creating any required support classes needed to emit the DWARF.
uint16_t DwarfVersion
the version of DWARF to emit.

Returns

a llvm::Expected that either contains a unique_ptr to a Generator or a llvm::Error.

llvm::StringRef generate()

Description

Generate all DWARF sections and return a memory buffer that contains an ELF file that contains the DWARF.

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

llvm::DIEAbbrevSet& getAbbrevSet()

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

llvm::BumpPtrAllocator& getAllocator()

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

llvm::AsmPrinter* getAsmPrinter() const

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

llvm::MCContext* getMCContext() const

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

llvm::MCSymbol* getStringOffsetsStartSym() const

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

llvm::DwarfStringPool& getStringPool()

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

bool saveFile(llvm::StringRef Path)

Description

Save the generated DWARF file to disk.

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

Parameters

llvm::StringRef Path
the path to save the ELF file to.

~Generator()

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