LLVM: llvm::DWARFContext Class Reference (original) (raw)

DWARFContext This data structure is the top level entity that deals with dwarf debug information parsing. More...

#include "[llvm/DebugInfo/DWARF/DWARFContext.h](DWARFContext%5F8h%5Fsource.html)"

Public Types
enum class ProcessDebugRelocations { Process, Ignore }
using unit_iterator_range = DWARFUnitVector::iterator_range
using compile_unit_range = DWARFUnitVector::compile_unit_range
Public Types inherited from llvm::DIContext
enum DIContextKind { CK_DWARF, CK_PDB, CK_BTF, CK_GSYM }
Public Member Functions
DWARFContext (std::unique_ptr< const DWARFObject > DObj, std::string DWPName="", std::function< void(Error)> RecoverableErrorHandler=WithColor::defaultErrorHandler, std::function< void(Error)> WarningHandler=WithColor::defaultWarningHandler, bool ThreadSafe=false)
~DWARFContext () override
DWARFContext (DWARFContext &)=delete
DWARFContext & operator= (DWARFContext &)=delete
const DWARFObject & getDWARFObj () const
void dump (raw_ostream &OS, DIDumpOptions DumpOpts, std::array< std::optional< uint64_t >, DIDT_ID_Count > DumpOffsets)
Dump a textual representation to OS.
void dump (raw_ostream &OS, DIDumpOptions DumpOpts) override
bool verify (raw_ostream &OS, DIDumpOptions DumpOpts={}) override
unit_iterator_range info_section_units ()
Get units from .debug_info in this context.
const DWARFUnitVector & getNormalUnitsVector ()
unit_iterator_range types_section_units ()
Get units from .debug_types in this context.
compile_unit_range compile_units ()
Get compile units in this context.
unit_iterator_range normal_units ()
Get all normal compile/type units in this context.
unit_iterator_range dwo_info_section_units ()
Get units from .debug_info..dwo in the DWO context.
const DWARFUnitVector & getDWOUnitsVector ()
bool isDWP () const
Return true of this DWARF context is a DWP file.
unit_iterator_range dwo_types_section_units ()
Get units from .debug_types.dwo in the DWO context.
compile_unit_range dwo_compile_units ()
Get compile units in the DWO context.
unit_iterator_range dwo_units ()
Get all units in the DWO context.
unsigned getNumCompileUnits ()
Get the number of compile units in this context.
unsigned getNumTypeUnits ()
Get the number of type units in this context.
unsigned getNumDWOCompileUnits ()
Get the number of compile units in the DWO context.
unsigned getNumDWOTypeUnits ()
Get the number of type units in the DWO context.
DWARFUnit * getUnitAtIndex (unsigned index)
Get the unit at the specified index.
DWARFUnit * getDWOUnitAtIndex (unsigned index)
Get the unit at the specified index for the DWO units.
DWARFCompileUnit * getDWOCompileUnitForHash (uint64_t Hash)
DWARFTypeUnit * getTypeUnitForHash (uint64_t Hash, bool IsDWO)
DWARFUnit * getUnitForOffset (uint64_t Offset)
Return the DWARF unit that includes an offset (relative to .debug_info).
DWARFCompileUnit * getCompileUnitForOffset (uint64_t Offset)
Return the compile unit that includes an offset (relative to .debug_info).
DWARFDie getDIEForOffset (uint64_t Offset)
Get a DIE given an exact offset.
unsigned getMaxVersion ()
unsigned getMaxDWOVersion ()
void setMaxVersionIfGreater (unsigned Version)
const DWARFUnitIndex & getCUIndex ()
DWARFGdbIndex & getGdbIndex ()
const DWARFUnitIndex & getTUIndex ()
const DWARFDebugAbbrev * getDebugAbbrev ()
Get a pointer to the parsed DebugAbbrev object.
const DWARFDebugLoc * getDebugLoc ()
Get a pointer to the parsed DebugLoc object.
const DWARFDebugAbbrev * getDebugAbbrevDWO ()
Get a pointer to the parsed dwo abbreviations object.
const DWARFDebugAranges * getDebugAranges ()
Get a pointer to the parsed DebugAranges object.
Expected< const DWARFDebugFrame * > getDebugFrame ()
Get a pointer to the parsed frame information object.
Expected< const DWARFDebugFrame * > getEHFrame ()
Get a pointer to the parsed eh frame information object.
const DWARFDebugMacro * getDebugMacinfo ()
Get a pointer to the parsed DebugMacinfo information object.
const DWARFDebugMacro * getDebugMacinfoDWO ()
Get a pointer to the parsed DebugMacinfoDWO information object.
const DWARFDebugMacro * getDebugMacro ()
Get a pointer to the parsed DebugMacro information object.
const DWARFDebugMacro * getDebugMacroDWO ()
Get a pointer to the parsed DebugMacroDWO information object.
const DWARFDebugNames & getDebugNames ()
Get a reference to the parsed accelerator table object.
const AppleAcceleratorTable & getAppleNames ()
Get a reference to the parsed accelerator table object.
const AppleAcceleratorTable & getAppleTypes ()
Get a reference to the parsed accelerator table object.
const AppleAcceleratorTable & getAppleNamespaces ()
Get a reference to the parsed accelerator table object.
const AppleAcceleratorTable & getAppleObjC ()
Get a reference to the parsed accelerator table object.
const DWARFDebugLine::LineTable * getLineTableForUnit (DWARFUnit *U)
Get a pointer to a parsed line table corresponding to a compile unit.
Expected< const DWARFDebugLine::LineTable * > getLineTableForUnit (DWARFUnit *U, function_ref< void(Error)> RecoverableErrorHandler)
Get a pointer to a parsed line table corresponding to a compile unit.
void clearLineTableForUnit (DWARFUnit *U)
DataExtractor getStringExtractor () const
DataExtractor getStringDWOExtractor () const
DataExtractor getLineStringExtractor () const
DIEsForAddress getDIEsForAddress (uint64_t Address, bool CheckDWO=false)
Get the compilation unit, the function DIE and lexical block DIE for the given address where applicable.
std::optional< DILineInfo > getLineInfoForAddress (object::SectionedAddress Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
std::optional< DILineInfo > getLineInfoForDataAddress (object::SectionedAddress Address) override
DILineInfoTable getLineInfoForAddressRange (object::SectionedAddress Address, uint64_t Size, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
DIInliningInfo getInliningInfoForAddress (object::SectionedAddress Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
std::vector< DILocal > getLocalsForAddress (object::SectionedAddress Address) override
bool isLittleEndian () const
std::shared_ptr< DWARFContext > getDWOContext (StringRef AbsolutePath)
function_ref< void(Error)> getRecoverableErrorHandler ()
function_ref< void(Error)> getWarningHandler ()
uint8_t getCUAddrSize ()
Get address size from CUs.
Triple::ArchType getArch () const
DWARFCompileUnit * getCompileUnitForCodeAddress (uint64_t Address)
Return the compile unit which contains instruction with provided address.
DWARFCompileUnit * getCompileUnitForDataAddress (uint64_t Address)
Return the compile unit which contains data with the provided address.
bool getParseCUTUIndexManually () const
Returns whether CU/TU should be populated manually.
void setParseCUTUIndexManually (bool PCUTU)
Sets whether CU/TU should be populated manually.
Public Member Functions inherited from llvm::DIContext
DIContext (DIContextKind K)
virtual ~DIContext ()=default
DIContextKind getKind () const
Static Public Member Functions
static bool classof (const DIContext *DICtx)
static unsigned getMaxSupportedVersion ()
static bool isSupportedVersion (unsigned version)
static SmallVector< uint8_t, 3 > getSupportedAddressSizes ()
static bool isAddressSizeSupported (unsigned AddressSize)
template<typename... Ts>
static Error checkAddressSizeSupported (unsigned AddressSize, std::error_code EC, char const *Fmt, const Ts &...Vals)
static std::unique_ptr< DWARFContext > create (const object::ObjectFile &Obj, ProcessDebugRelocations RelocAction=ProcessDebugRelocations::Process, const LoadedObjectInfo *L=nullptr, std::string DWPName="", std::function< void(Error)> RecoverableErrorHandler=WithColor::defaultErrorHandler, std::function< void(Error)> WarningHandler=WithColor::defaultWarningHandler, bool ThreadSafe=false)
static std::unique_ptr< DWARFContext > create (const StringMap< std::unique_ptr< MemoryBuffer > > &Sections, uint8_t AddrSize, bool isLittleEndian=sys::IsLittleEndianHost, std::function< void(Error)> RecoverableErrorHandler=WithColor::defaultErrorHandler, std::function< void(Error)> WarningHandler=WithColor::defaultWarningHandler, bool ThreadSafe=false)
Friends
class DWARFContextState

DWARFContext This data structure is the top level entity that deals with dwarf debug information parsing.

The actual data is supplied through DWARFObj.

Definition at line 49 of file DWARFContext.h.

compile_unit_range

unit_iterator_range

ProcessDebugRelocations

~DWARFContext()

DWARFContext::~DWARFContext ( ) overridedefault

DWARFContext() [2/2]

checkAddressSizeSupported()

template<typename... Ts>

Error llvm::DWARFContext::checkAddressSizeSupported ( unsigned AddressSize, std::error_code EC, char const * Fmt, const Ts &... Vals ) inlinestatic

classof()

clearLineTableForUnit()

void DWARFContext::clearLineTableForUnit ( DWARFUnit * U )

compile_units()

compile_unit_range llvm::DWARFContext::compile_units ( ) inline

create() [1/2]

create() [2/2]

dump() [1/2]

dump() [2/2]

Dump a textual representation to OS.

If any DumpOffsets are present, dump only the record at the specified offset.

Definition at line 985 of file DWARFContext.cpp.

References compile_units(), llvm::Data, DF, llvm::DIDT_All, llvm::DIDT_ID_Count, llvm::DIDT_UUID, llvm::DIDumpOptions::DisplayRawContents, llvm::AppleAcceleratorTable::dump(), llvm::DWARFDebugAbbrev::dump(), llvm::DWARFDebugArangeSet::dump(), llvm::DWARFDebugLoc::dump(), llvm::DWARFDebugNames::dump(), llvm::DWARFDebugRangeList::dump(), llvm::DWARFDie::dump(), llvm::DWARFGdbIndex::dump(), llvm::DWARFUnitIndex::dump(), dumpAddrSection(), dumpLoclistsSection(), dumpPubTableSection(), dumpRnglistsSection(), dumpStringOffsetsSection(), llvm::DIDumpOptions::DumpType, dumpUUID(), dwo_info_section_units(), dwo_types_section_units(), dwo_units(), llvm::sys::path::extension(), llvm::DWARFDebugArangeSet::extract(), llvm::DWARFDebugRangeList::extract(), llvm::format(), getAppleNames(), getAppleNamespaces(), getAppleObjC(), getAppleTypes(), llvm::DataExtractor::getCStr(), getCUAddrSize(), getCUIndex(), getDebugAbbrev(), getDebugAbbrevDWO(), getDebugFrame(), getDebugLoc(), getDebugMacinfo(), getDebugMacinfoDWO(), getDebugMacro(), getDebugMacroDWO(), getDebugNames(), llvm::DWARFUnit::getDIEForOffset(), llvm::DWARFDie::getDwarfUnit(), getEHFrame(), getGdbIndex(), getMaxVersion(), getNumCompileUnits(), getNumDWOCompileUnits(), getNumDWOTypeUnits(), getNumTypeUnits(), getTUIndex(), I, info_section_units(), isLittleEndian(), llvm::DataExtractor::isValidOffset(), llvm::Macro, llvm::DIDumpOptions::noImplicitRecursion(), normal_units(), llvm::Offset, llvm::DIDumpOptions::RecoverableErrorHandler, llvm::Error::success(), types_section_units(), llvm::DIDumpOptions::Verbose, llvm::DIDumpOptions::WarningHandler, and llvm::raw_ostream::write_escaped().

Referenced by dump().

dwo_compile_units()

compile_unit_range llvm::DWARFContext::dwo_compile_units ( ) inline

dwo_info_section_units()

unit_iterator_range llvm::DWARFContext::dwo_info_section_units ( ) inline

dwo_types_section_units()

unit_iterator_range llvm::DWARFContext::dwo_types_section_units ( ) inline

dwo_units()

unit_iterator_range llvm::DWARFContext::dwo_units ( ) inline

getAppleNames()

getAppleNamespaces()

getAppleObjC()

getAppleTypes()

getArch()

getCompileUnitForCodeAddress()

getCompileUnitForDataAddress()

getCompileUnitForOffset()

getCUAddrSize()

uint8_t DWARFContext::getCUAddrSize ( )

getCUIndex()

getDebugAbbrev()

getDebugAbbrevDWO()

getDebugAranges()

getDebugFrame()

getDebugLoc()

getDebugMacinfo()

Get a pointer to the parsed DebugMacinfo information object.

Definition at line 1466 of file DWARFContext.cpp.

Referenced by dump().

getDebugMacinfoDWO()

Get a pointer to the parsed DebugMacinfoDWO information object.

Definition at line 1470 of file DWARFContext.cpp.

Referenced by dump().

getDebugMacro()

Get a pointer to the parsed DebugMacro information object.

Definition at line 1458 of file DWARFContext.cpp.

Referenced by dump().

getDebugMacroDWO()

Get a pointer to the parsed DebugMacroDWO information object.

Definition at line 1462 of file DWARFContext.cpp.

Referenced by dump().

getDebugNames()

getDIEForOffset()

getDIEsForAddress()

getDWARFObj()

getDWOCompileUnitForHash()

getDWOContext()

getDWOUnitAtIndex()

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

Definition at line 263 of file DWARFContext.h.

getDWOUnitsVector()

getEHFrame()

getGdbIndex()

getInliningInfoForAddress()

Implements llvm::DIContext.

Definition at line 1834 of file DWARFContext.cpp.

References llvm::DIInliningInfo::addFrame(), llvm::Address, llvm::DILineInfo::Column, llvm::DILineInfo::Discriminator, llvm::DILineInfo::FileName, llvm::DWARFDie::find(), llvm::DILineInfo::FunctionName, llvm::DWARFDie::getCallerFrame(), getCompileUnitForCodeAddress(), llvm::DWARFDie::getDeclFile(), llvm::DWARFDie::getDeclLine(), llvm::DWARFDebugLine::LineTable::getFileLineInfoForAddress(), llvm::DWARFDebugLine::LineTable::getFileNameByIndex(), getLineTableForUnit(), llvm::DWARFDie::getSubroutineName(), llvm::DILineInfo::Line, llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::DILineInfo::StartAddress, llvm::DILineInfo::StartFileName, llvm::DILineInfo::StartLine, and llvm::dwarf::toSectionedAddress().

getLineInfoForAddress()

getLineInfoForAddressRange()

getLineInfoForDataAddress()

getLineStringExtractor()

DataExtractor llvm::DWARFContext::getLineStringExtractor ( ) const inline

getLineTableForUnit() [1/2]

getLineTableForUnit() [2/2]

Get a pointer to a parsed line table corresponding to a compile unit.

Report any recoverable parsing problems using the handler.

Definition at line 1506 of file DWARFContext.cpp.

getLocalsForAddress()

getMaxDWOVersion()

unsigned llvm::DWARFContext::getMaxDWOVersion ( ) inline

getMaxSupportedVersion()

unsigned llvm::DWARFContext::getMaxSupportedVersion ( ) inlinestatic

getMaxVersion()

unsigned llvm::DWARFContext::getMaxVersion ( ) inline

getNormalUnitsVector()

getNumCompileUnits()

unsigned llvm::DWARFContext::getNumCompileUnits ( ) inline

Get the number of compile units in this context.

Definition at line 238 of file DWARFContext.h.

Referenced by dump().

getNumDWOCompileUnits()

unsigned llvm::DWARFContext::getNumDWOCompileUnits ( ) inline

Get the number of compile units in the DWO context.

Definition at line 248 of file DWARFContext.h.

Referenced by dump().

getNumDWOTypeUnits()

unsigned llvm::DWARFContext::getNumDWOTypeUnits ( ) inline

Get the number of type units in the DWO context.

Definition at line 253 of file DWARFContext.h.

Referenced by dump().

getNumTypeUnits()

unsigned llvm::DWARFContext::getNumTypeUnits ( ) inline

getParseCUTUIndexManually()

bool llvm::DWARFContext::getParseCUTUIndexManually ( ) const inline

Returns whether CU/TU should be populated manually.

TU Index populated manually only for DWARF5.

Definition at line 488 of file DWARFContext.h.

getRecoverableErrorHandler()

getStringDWOExtractor()

DataExtractor llvm::DWARFContext::getStringDWOExtractor ( ) const inline

getStringExtractor()

DataExtractor llvm::DWARFContext::getStringExtractor ( ) const inline

getSupportedAddressSizes()

getTUIndex()

getTypeUnitForHash()

getUnitAtIndex()

getUnitForOffset()

getWarningHandler()

info_section_units()

unit_iterator_range llvm::DWARFContext::info_section_units ( ) inline

isAddressSizeSupported()

bool llvm::DWARFContext::isAddressSizeSupported ( unsigned AddressSize) inlinestatic

isDWP()

bool DWARFContext::isDWP ( ) const

isLittleEndian()

bool llvm::DWARFContext::isLittleEndian ( ) const inline

isSupportedVersion()

bool llvm::DWARFContext::isSupportedVersion ( unsigned version) inlinestatic

normal_units()

unit_iterator_range llvm::DWARFContext::normal_units ( ) inline

operator=()

setMaxVersionIfGreater()

void llvm::DWARFContext::setMaxVersionIfGreater ( unsigned Version) inline

setParseCUTUIndexManually()

void llvm::DWARFContext::setParseCUTUIndexManually ( bool PCUTU) inline

Sets whether CU/TU should be populated manually.

TU Index populated manually only for DWARF5.

Definition at line 492 of file DWARFContext.h.

types_section_units()

unit_iterator_range llvm::DWARFContext::types_section_units ( ) inline

verify()

DWARFContextState

friend class DWARFContextState friend

The documentation for this class was generated from the following files: