class DWARFContext

Declaration

class DWARFContext : public DIContext { /* full declaration omitted */ };

Description

DWARFContext This data structure is the top level entity that deals with dwarf debug information parsing. The actual data is supplied through DWARFObj.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:58

Inherits from: DIContext

Method Overview

Inherited from DIContext:

Methods

DWARFContext(
    std::unique_ptr<const DWARFObject> DObj,
    std::string DWPName = "")

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:109

Parameters

std::unique_ptr<const DWARFObject> DObj
std::string DWPName = ""

DWARFContext(llvm::DWARFContext&)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:113

Parameters

llvm::DWARFContext&

static bool classof(const llvm::DIContext* DICtx)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:118

Parameters

const llvm::DIContext* DICtx

llvm::DWARFContext::unit_iterator_range
compile_units()

Description

Get compile units in this context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:152

static std::unique_ptr<DWARFContext> create(
    const StringMap<
        std::unique_ptr<MemoryBuffer>>& Sections,
    uint8_t AddrSize,
    bool isLittleEndian = sys::IsLittleEndianHost)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:355

Parameters

const StringMap<std::unique_ptr<MemoryBuffer>>& Sections
uint8_t AddrSize
bool isLittleEndian = sys::IsLittleEndianHost

static std::unique_ptr<DWARFContext> create(
    const object::ObjectFile& Obj,
    const llvm::LoadedObjectInfo* L = nullptr,
    function_ref<llvm::ErrorPolicy(llvm::Error)>
        HandleError = defaultErrorHandler,
    std::string DWPName = "")

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:350

Parameters

const object::ObjectFile& Obj
const llvm::LoadedObjectInfo* L = nullptr
function_ref<llvm::ErrorPolicy(llvm::Error)> HandleError = defaultErrorHandler
std::string DWPName = ""

static llvm::ErrorPolicy defaultErrorHandler(
    llvm::Error E)

Description

Function used to handle default error reporting policy. Prints a error message and returns Continue, so DWARF context ignores the error.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:348

Parameters

llvm::Error E

void dump(llvm::raw_ostream& OS,
          llvm::DIDumpOptions DumpOpts,
          std::array<Optional<uint64_t>,
                     DIDT_ID_Count> DumpOffsets)

Description

Dump a textual representation to \p OS. If any \p DumpOffsets are present, dump only the record at the specified offset.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:124

Parameters

llvm::raw_ostream& OS
llvm::DIDumpOptions DumpOpts
std::array<Optional<uint64_t>, DIDT_ID_Count> DumpOffsets

void dump(llvm::raw_ostream& OS,
          llvm::DIDumpOptions DumpOpts)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:127

Parameters

llvm::raw_ostream& OS
llvm::DIDumpOptions DumpOpts

static void dumpWarning(llvm::Error Warning)

Description

Dump Error as warning message to stderr.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:368

Parameters

llvm::Error Warning

llvm::DWARFContext::unit_iterator_range
dwo_compile_units()

Description

Get compile units in the DWO context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:178

llvm::DWARFContext::unit_iterator_range
dwo_info_section_units()

Description

Get units from .debug_info..dwo in the DWO context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:164

llvm::DWARFContext::unit_iterator_range
dwo_type_units()

Description

Get type units in the DWO context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:181

llvm::DWARFContext::unit_iterator_range
dwo_types_section_units()

Description

Get units from .debug_types.dwo in the DWO context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:171

llvm::DWARFContext::unit_iterator_range
dwo_units()

Description

Get all units in the DWO context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:184

const llvm::AppleAcceleratorTable& getAppleNames()

Description

Get a reference to the parsed accelerator table object.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:282

const llvm::AppleAcceleratorTable&
getAppleNamespaces()

Description

Get a reference to the parsed accelerator table object.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:288

const llvm::AppleAcceleratorTable& getAppleObjC()

Description

Get a reference to the parsed accelerator table object.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:291

const llvm::AppleAcceleratorTable& getAppleTypes()

Description

Get a reference to the parsed accelerator table object.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:285

Triple::ArchType getArch() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:370

uint8_t getCUAddrSize()

Description

Get address size from CUs. TODO: refactor compile_units() to make this const.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:365

const llvm::DWARFUnitIndex& getCUIndex()

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:250

llvm::DWARFCompileUnit* getCompileUnitForOffset(
    uint64_t Offset)

Description

Return the compile unit that includes an offset (relative to .debug_info).

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:228

Parameters

uint64_t Offset

llvm::DWARFDie getDIEForOffset(uint64_t Offset)

Description

Get a DIE given an exact offset.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:231

Parameters

uint64_t Offset

llvm::DWARFContext::DIEsForAddress
getDIEsForAddress(uint64_t Address)

Description

Get the compilation unit, the function DIE and lexical block DIE for the given address where applicable. TODO: change input parameter from "uint64_t Address" into "SectionedAddress Address"

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:322

Parameters

uint64_t Address

const llvm::DWARFObject& getDWARFObj() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:116

llvm::DWARFCompileUnit* getDWOCompileUnitForHash(
    uint64_t Hash)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:225

Parameters

uint64_t Hash

std::shared_ptr<DWARFContext> getDWOContext(
    llvm::StringRef AbsolutePath)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:342

Parameters

llvm::StringRef AbsolutePath

llvm::DWARFUnit* getDWOUnitAtIndex(
    unsigned int index)

Description

Get the unit at the specified index for the DWO units.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:220

Parameters

unsigned int index

const llvm::DWARFDebugAbbrev* getDebugAbbrev()

Description

Get a pointer to the parsed DebugAbbrev object.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:255

const llvm::DWARFDebugAbbrev* getDebugAbbrevDWO()

Description

Get a pointer to the parsed dwo abbreviations object.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:261

const llvm::DWARFDebugAranges* getDebugAranges()

Description

Get a pointer to the parsed DebugAranges object.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:264

const llvm::DWARFDebugFrame* getDebugFrame()

Description

Get a pointer to the parsed frame information object.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:267

const llvm::DWARFDebugLoc* getDebugLoc()

Description

Get a pointer to the parsed DebugLoc object.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:258

const llvm::DWARFDebugMacro* getDebugMacro()

Description

Get a pointer to the parsed DebugMacro object.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:273

const llvm::DWARFDebugMacro* getDebugMacroDWO()

Description

Get a pointer to the parsed DebugMacroDWO object.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:276

const llvm::DWARFDebugNames& getDebugNames()

Description

Get a reference to the parsed accelerator table object.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:279

const llvm::DWARFDebugFrame* getEHFrame()

Description

Get a pointer to the parsed eh frame information object.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:270

llvm::DWARFGdbIndex& getGdbIndex()

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:251

llvm::DIInliningInfo getInliningInfoForAddress(
    object::SectionedAddress Address,
    llvm::DILineInfoSpecifier Specifier =
        llvm::DILineInfoSpecifier())

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:330

Parameters

object::SectionedAddress Address
llvm::DILineInfoSpecifier Specifier = llvm::DILineInfoSpecifier()

llvm::DILineInfo getLineInfoForAddress(
    object::SectionedAddress Address,
    llvm::DILineInfoSpecifier Specifier =
        llvm::DILineInfoSpecifier())

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:324

Parameters

object::SectionedAddress Address
llvm::DILineInfoSpecifier Specifier = llvm::DILineInfoSpecifier()

llvm::DILineInfoTable getLineInfoForAddressRange(
    object::SectionedAddress Address,
    uint64_t Size,
    llvm::DILineInfoSpecifier Specifier =
        llvm::DILineInfoSpecifier())

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:327

Parameters

object::SectionedAddress Address
uint64_t Size
llvm::DILineInfoSpecifier Specifier = llvm::DILineInfoSpecifier()

llvm::DataExtractor getLineStringExtractor() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:306

const DWARFDebugLine::LineTable*
getLineTableForUnit(llvm::DWARFUnit* U)

Description

Get a pointer to a parsed line table corresponding to a compile unit. Report any parsing issues as warnings on stderr.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:295

Parameters

llvm::DWARFUnit* U

Expected<const DWARFDebugLine::LineTable*>
getLineTableForUnit(
    llvm::DWARFUnit* U,
    function_ref<void(llvm::Error)>
        RecoverableErrorCallback)

Description

Get a pointer to a parsed line table corresponding to a compile unit. Report any recoverable parsing problems using the callback.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:300

Parameters

llvm::DWARFUnit* U
function_ref<void(llvm::Error)> RecoverableErrorCallback

std::vector<DILocal> getLocalsForAddress(
    object::SectionedAddress Address)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:335

Parameters

object::SectionedAddress Address

unsigned int getMaxDWOVersion()

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:239

unsigned int getMaxVersion()

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:233

unsigned int getNumCompileUnits()

Description

Get the number of compile units in this context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:190

unsigned int getNumDWOCompileUnits()

Description

Get the number of compile units in the DWO context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:202

unsigned int getNumDWOTypeUnits()

Description

Get the number of type units in the DWO context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:208

unsigned int getNumTypeUnits()

Description

Get the number of type units in this context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:196

const llvm::MCRegisterInfo* getRegisterInfo()
    const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:344

llvm::DataExtractor getStringExtractor() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:303

const llvm::DWARFUnitIndex& getTUIndex()

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:252

llvm::DWARFUnit* getUnitAtIndex(
    unsigned int index)

Description

Get the unit at the specified index.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:214

Parameters

unsigned int index

llvm::DWARFContext::unit_iterator_range
info_section_units()

Description

Get units from .debug_info in this context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:137

bool isLittleEndian() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:337

static bool isSupportedVersion(
    unsigned int version)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:338

Parameters

unsigned int version

llvm::Error loadRegisterInfo(
    const object::ObjectFile& Obj)

Description

Loads register info for the architecture of the provided object file. Improves readability of dumped DWARF expressions. Requires the caller to have initialized the relevant target descriptions.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:361

Parameters

const object::ObjectFile& Obj

llvm::DWARFContext::unit_iterator_range
normal_units()

Description

Get all normal compile/type units in this context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:158

void setMaxVersionIfGreater(unsigned int Version)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:245

Parameters

unsigned int Version

llvm::DWARFContext::unit_iterator_range
type_units()

Description

Get type units in this context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:155

llvm::DWARFContext::unit_iterator_range
types_section_units()

Description

Get units from .debug_types in this context.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:145

bool verify(llvm::raw_ostream& OS,
            llvm::DIDumpOptions DumpOpts = {})

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:132

Parameters

llvm::raw_ostream& OS
llvm::DIDumpOptions DumpOpts = {}

~DWARFContext()

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:111