LLVM  12.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::DWARFContext Class Reference

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

#include "llvm/DebugInfo/DWARF/DWARFContext.h"

Inheritance diagram for llvm::DWARFContext:
Inheritance graph
[legend]
Collaboration diagram for llvm::DWARFContext:
Collaboration graph
[legend]

Classes

struct  DIEsForAddress
 Wraps the returned DIEs for a given address. More...
 

Public Types

using unit_iterator_range = DWARFUnitVector::iterator_range
 
- Public Types inherited from llvm::DIContext
enum  DIContextKind { CK_DWARF, CK_PDB }
 

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)
 
 ~DWARFContext ()
 
 DWARFContext (DWARFContext &)=delete
 
DWARFContextoperator= (DWARFContext &)=delete
 
const DWARFObjectgetDWARFObj () const
 
void dump (raw_ostream &OS, DIDumpOptions DumpOpts, std::array< Optional< uint64_t >, DIDT_ID_Count > DumpOffsets)
 Dump a textual representation to OS. More...
 
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. More...
 
unit_iterator_range types_section_units ()
 Get units from .debug_types in this context. More...
 
unit_iterator_range compile_units ()
 Get compile units in this context. More...
 
unit_iterator_range type_units ()
 Get type units in this context. More...
 
unit_iterator_range normal_units ()
 Get all normal compile/type units in this context. More...
 
unit_iterator_range dwo_info_section_units ()
 Get units from .debug_info..dwo in the DWO context. More...
 
unit_iterator_range dwo_types_section_units ()
 Get units from .debug_types.dwo in the DWO context. More...
 
unit_iterator_range dwo_compile_units ()
 Get compile units in the DWO context. More...
 
unit_iterator_range dwo_type_units ()
 Get type units in the DWO context. More...
 
unit_iterator_range dwo_units ()
 Get all units in the DWO context. More...
 
unsigned getNumCompileUnits ()
 Get the number of compile units in this context. More...
 
unsigned getNumTypeUnits ()
 Get the number of type units in this context. More...
 
unsigned getNumDWOCompileUnits ()
 Get the number of compile units in the DWO context. More...
 
unsigned getNumDWOTypeUnits ()
 Get the number of type units in the DWO context. More...
 
DWARFUnitgetUnitAtIndex (unsigned index)
 Get the unit at the specified index. More...
 
DWARFUnitgetDWOUnitAtIndex (unsigned index)
 Get the unit at the specified index for the DWO units. More...
 
DWARFCompileUnitgetDWOCompileUnitForHash (uint64_t Hash)
 
DWARFCompileUnitgetCompileUnitForOffset (uint64_t Offset)
 Return the compile unit that includes an offset (relative to .debug_info). More...
 
DWARFDie getDIEForOffset (uint64_t Offset)
 Get a DIE given an exact offset. More...
 
unsigned getMaxVersion ()
 
unsigned getMaxDWOVersion ()
 
void setMaxVersionIfGreater (unsigned Version)
 
const DWARFUnitIndexgetCUIndex ()
 
DWARFGdbIndexgetGdbIndex ()
 
const DWARFUnitIndexgetTUIndex ()
 
const DWARFDebugAbbrevgetDebugAbbrev ()
 Get a pointer to the parsed DebugAbbrev object. More...
 
const DWARFDebugLocgetDebugLoc ()
 Get a pointer to the parsed DebugLoc object. More...
 
const DWARFDebugAbbrevgetDebugAbbrevDWO ()
 Get a pointer to the parsed dwo abbreviations object. More...
 
const DWARFDebugArangesgetDebugAranges ()
 Get a pointer to the parsed DebugAranges object. More...
 
Expected< const DWARFDebugFrame * > getDebugFrame ()
 Get a pointer to the parsed frame information object. More...
 
Expected< const DWARFDebugFrame * > getEHFrame ()
 Get a pointer to the parsed eh frame information object. More...
 
const DWARFDebugMacrogetDebugMacinfo ()
 Get a pointer to the parsed DebugMacinfo information object. More...
 
const DWARFDebugMacrogetDebugMacinfoDWO ()
 Get a pointer to the parsed DebugMacinfoDWO information object. More...
 
const DWARFDebugMacrogetDebugMacro ()
 Get a pointer to the parsed DebugMacro information object. More...
 
const DWARFDebugMacrogetDebugMacroDWO ()
 Get a pointer to the parsed DebugMacroDWO information object. More...
 
const DWARFDebugNamesgetDebugNames ()
 Get a reference to the parsed accelerator table object. More...
 
const AppleAcceleratorTablegetAppleNames ()
 Get a reference to the parsed accelerator table object. More...
 
const AppleAcceleratorTablegetAppleTypes ()
 Get a reference to the parsed accelerator table object. More...
 
const AppleAcceleratorTablegetAppleNamespaces ()
 Get a reference to the parsed accelerator table object. More...
 
const AppleAcceleratorTablegetAppleObjC ()
 Get a reference to the parsed accelerator table object. More...
 
const DWARFDebugLine::LineTablegetLineTableForUnit (DWARFUnit *U)
 Get a pointer to a parsed line table corresponding to a compile unit. More...
 
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. More...
 
DataExtractor getStringExtractor () const
 
DataExtractor getStringDWOExtractor () const
 
DataExtractor getLineStringExtractor () const
 
DIEsForAddress getDIEsForAddress (uint64_t Address)
 Get the compilation unit, the function DIE and lexical block DIE for the given address where applicable. More...
 
DILineInfo getLineInfoForAddress (object::SectionedAddress Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
 
DILineInfoTable getLineInfoForAddressRange (object::SectionedAddress Address, uint64_t Size, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
 
DIInliningInfo getInliningInfoForAddress (object::SectionedAddress Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
 
std::vector< DILocalgetLocalsForAddress (object::SectionedAddress Address) override
 
bool isLittleEndian () const
 
std::shared_ptr< DWARFContextgetDWOContext (StringRef AbsolutePath)
 
const MCRegisterInfogetRegisterInfo () const
 
function_ref< void(Error)> getRecoverableErrorHandler ()
 
function_ref< void(Error)> getWarningHandler ()
 
Error loadRegisterInfo (const object::ObjectFile &Obj)
 Loads register info for the architecture of the provided object file. More...
 
uint8_t getCUAddrSize ()
 Get address size from CUs. More...
 
Triple::ArchType getArch () const
 
DWARFCompileUnitgetCompileUnitForAddress (uint64_t Address)
 Return the compile unit which contains instruction with provided address. More...
 
- 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 bool isSupportedVersion (unsigned version)
 
static bool isAddressSizeSupported (unsigned AddressSize)
 
static std::unique_ptr< DWARFContextcreate (const object::ObjectFile &Obj, const LoadedObjectInfo *L=nullptr, std::string DWPName="", std::function< void(Error)> RecoverableErrorHandler=WithColor::defaultErrorHandler, std::function< void(Error)> WarningHandler=WithColor::defaultWarningHandler)
 
static std::unique_ptr< DWARFContextcreate (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)
 

Detailed Description

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 53 of file DWARFContext.h.

Member Typedef Documentation

◆ unit_iterator_range

Definition at line 148 of file DWARFContext.h.

Constructor & Destructor Documentation

◆ DWARFContext() [1/2]

DWARFContext::DWARFContext ( std::unique_ptr< const DWARFObject DObj,
std::string  DWPName = "",
std::function< void(Error)>  RecoverableErrorHandler = WithColor::defaultErrorHandler,
std::function< void(Error)>  WarningHandler = WithColor::defaultWarningHandler 
)

Definition at line 67 of file DWARFContext.cpp.

References ~DWARFContext().

◆ ~DWARFContext()

DWARFContext::~DWARFContext ( )
default

Referenced by DWARFContext().

◆ DWARFContext() [2/2]

llvm::DWARFContext::DWARFContext ( DWARFContext )
delete

Member Function Documentation

◆ classof()

static bool llvm::DWARFContext::classof ( const DIContext DICtx)
inlinestatic

◆ compile_units()

unit_iterator_range llvm::DWARFContext::compile_units ( )
inline

Get compile units in this context.

Definition at line 166 of file DWARFContext.h.

References info_section_units().

Referenced by dump(), llvm::DWARFDebugAranges::generate(), getCUAddrSize(), llvm::getDebugInfoSize(), and llvm::DWARFVerifier::handleDebugLine().

◆ create() [1/2]

std::unique_ptr< DWARFContext > DWARFContext::create ( const object::ObjectFile Obj,
const LoadedObjectInfo L = nullptr,
std::string  DWPName = "",
std::function< void(Error)>  RecoverableErrorHandler = WithColor::defaultErrorHandler,
std::function< void(Error)>  WarningHandler = WithColor::defaultWarningHandler 
)
static

◆ create() [2/2]

std::unique_ptr< DWARFContext > 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 
)
static

Definition at line 1959 of file DWARFContext.cpp.

References isLittleEndian().

◆ dump() [1/2]

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

Dump a textual representation to OS.

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

Definition at line 346 of file DWARFContext.cpp.

References compile_units(), llvm::Data, DF, llvm::DIDT_All, llvm::DIDT_UUID, llvm::DIDumpOptions::DisplayRawContents, llvm::DWARFDebugLine::SectionParser::done(), llvm::DWARFDebugAbbrev::dump(), llvm::DWARFDebugRangeList::dump(), llvm::DWARFGdbIndex::dump(), llvm::DWARFDebugLoc::dump(), llvm::DWARFUnitIndex::dump(), llvm::AppleAcceleratorTable::dump(), llvm::DWARFDebugNames::dump(), dumpAddrSection(), dumpLoclistsSection(), dumpPubTableSection(), dumpRnglistsSection(), dumpStringOffsetsSection(), llvm::DIDumpOptions::DumpType, dumpUUID(), dwo_compile_units(), dwo_info_section_units(), dwo_type_units(), dwo_types_section_units(), dwo_units(), E, llvm::sys::path::extension(), llvm::DWARFDebugRangeList::extract(), extract, llvm::format(), getAppleNames(), getAppleNamespaces(), getAppleObjC(), getAppleTypes(), getCUAddrSize(), getCUIndex(), getDebugAbbrev(), getDebugAbbrevDWO(), getDebugFrame(), getDebugLoc(), getDebugMacinfo(), getDebugMacinfoDWO(), getDebugMacro(), getDebugMacroDWO(), getDebugNames(), getEHFrame(), getGdbIndex(), getMaxVersion(), getNumCompileUnits(), getNumDWOCompileUnits(), getNumDWOTypeUnits(), getNumTypeUnits(), llvm::DWARFDebugLine::SectionParser::getOffset(), getRegisterInfo(), getTUIndex(), I, info_section_units(), isLittleEndian(), llvm::BitmaskEnumDetail::Mask(), Name, llvm::DIDumpOptions::noImplicitRecursion(), llvm::None, normal_units(), llvm::DWARFDebugLine::SectionParser::parseNext(), llvm::ARMBuildAttrs::Section, llvm::DWARFDebugLine::SectionParser::skip(), type_units(), types_section_units(), llvm::DIDumpOptions::Verbose, and llvm::raw_ostream::write_escaped().

Referenced by classof(), and dump().

◆ dump() [2/2]

void llvm::DWARFContext::dump ( raw_ostream OS,
DIDumpOptions  DumpOpts 
)
inlineoverridevirtual

Implements llvm::DIContext.

Definition at line 141 of file DWARFContext.h.

References llvm::DIDT_ID_Count, dump(), and verify().

◆ dwo_compile_units()

unit_iterator_range llvm::DWARFContext::dwo_compile_units ( )
inline

Get compile units in the DWO context.

Definition at line 192 of file DWARFContext.h.

References dwo_info_section_units().

Referenced by dump(), and getDWOCompileUnitForHash().

◆ dwo_info_section_units()

unit_iterator_range llvm::DWARFContext::dwo_info_section_units ( )
inline

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

Definition at line 178 of file DWARFContext.h.

References llvm::SmallVectorTemplateCommon< T, typename >::begin(), and llvm::DWARFUnitVector::getNumInfoUnits().

Referenced by dump(), dwo_compile_units(), and getMaxDWOVersion().

◆ dwo_type_units()

unit_iterator_range llvm::DWARFContext::dwo_type_units ( )
inline

Get type units in the DWO context.

Definition at line 195 of file DWARFContext.h.

References dwo_types_section_units().

Referenced by dump().

◆ dwo_types_section_units()

unit_iterator_range llvm::DWARFContext::dwo_types_section_units ( )
inline

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

Definition at line 185 of file DWARFContext.h.

References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), and llvm::DWARFUnitVector::getNumInfoUnits().

Referenced by dump(), and dwo_type_units().

◆ dwo_units()

unit_iterator_range llvm::DWARFContext::dwo_units ( )
inline

Get all units in the DWO context.

Definition at line 198 of file DWARFContext.h.

References llvm::SmallVectorTemplateCommon< T, typename >::begin(), and llvm::SmallVectorTemplateCommon< T, typename >::end().

Referenced by dump().

◆ getAppleNames()

const AppleAcceleratorTable & DWARFContext::getAppleNames ( )

Get a reference to the parsed accelerator table object.

Definition at line 906 of file DWARFContext.cpp.

References getAccelTable(), and isLittleEndian().

Referenced by dump(), and setMaxVersionIfGreater().

◆ getAppleNamespaces()

const AppleAcceleratorTable & DWARFContext::getAppleNamespaces ( )

Get a reference to the parsed accelerator table object.

Definition at line 916 of file DWARFContext.cpp.

References getAccelTable(), and isLittleEndian().

Referenced by dump(), and setMaxVersionIfGreater().

◆ getAppleObjC()

const AppleAcceleratorTable & DWARFContext::getAppleObjC ( )

Get a reference to the parsed accelerator table object.

Definition at line 922 of file DWARFContext.cpp.

References getAccelTable(), and isLittleEndian().

Referenced by dump(), and setMaxVersionIfGreater().

◆ getAppleTypes()

const AppleAcceleratorTable & DWARFContext::getAppleTypes ( )

Get a reference to the parsed accelerator table object.

Definition at line 911 of file DWARFContext.cpp.

References getAccelTable(), and isLittleEndian().

Referenced by dump(), and setMaxVersionIfGreater().

◆ getArch()

Triple::ArchType llvm::DWARFContext::getArch ( ) const
inline

◆ getCompileUnitForAddress()

DWARFCompileUnit * DWARFContext::getCompileUnitForAddress ( uint64_t  Address)

Return the compile unit which contains instruction with provided address.

TODO: change input parameter from "uint64_t Address" into "SectionedAddress Address"

Definition at line 997 of file DWARFContext.cpp.

References llvm::DWARFDebugAranges::findAddress(), getCompileUnitForOffset(), and getDebugAranges().

Referenced by getArch(), getDIEsForAddress(), getInliningInfoForAddress(), getLineInfoForAddress(), getLineInfoForAddressRange(), and getLocalsForAddress().

◆ getCompileUnitForOffset()

DWARFCompileUnit * DWARFContext::getCompileUnitForOffset ( uint64_t  Offset)

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

Definition at line 991 of file DWARFContext.cpp.

References llvm::DWARFUnitVector::getUnitForOffset().

Referenced by getCompileUnitForAddress(), and getDWOUnitAtIndex().

◆ getCUAddrSize()

uint8_t DWARFContext::getCUAddrSize ( )

Get address size from CUs.

TODO: refactor compile_units() to make this const.

Definition at line 1986 of file DWARFContext.cpp.

References llvm::iterator_range< IteratorT >::begin(), compile_units(), and llvm::iterator_range< IteratorT >::empty().

Referenced by dump(), and getWarningHandler().

◆ getCUIndex()

const DWARFUnitIndex & DWARFContext::getCUIndex ( )

◆ getDebugAbbrev()

const DWARFDebugAbbrev * DWARFContext::getDebugAbbrev ( )

Get a pointer to the parsed DebugAbbrev object.

Definition at line 782 of file DWARFContext.cpp.

References isLittleEndian().

Referenced by llvm::DWARFUnitVector::addUnitsForSection(), dump(), and setMaxVersionIfGreater().

◆ getDebugAbbrevDWO()

const DWARFDebugAbbrev * DWARFContext::getDebugAbbrevDWO ( )

Get a pointer to the parsed dwo abbreviations object.

Definition at line 793 of file DWARFContext.cpp.

References isLittleEndian().

Referenced by llvm::DWARFUnitVector::addUnitsForDWOSection(), dump(), and setMaxVersionIfGreater().

◆ getDebugAranges()

const DWARFDebugAranges * DWARFContext::getDebugAranges ( )

Get a pointer to the parsed DebugAranges object.

Definition at line 817 of file DWARFContext.cpp.

Referenced by getCompileUnitForAddress(), and setMaxVersionIfGreater().

◆ getDebugFrame()

Expected< const DWARFDebugFrame * > DWARFContext::getDebugFrame ( )

Get a pointer to the parsed frame information object.

Definition at line 826 of file DWARFContext.cpp.

References DF, E, getArch(), and isLittleEndian().

Referenced by dump(), and setMaxVersionIfGreater().

◆ getDebugLoc()

const DWARFDebugLoc * DWARFContext::getDebugLoc ( )

Get a pointer to the parsed DebugLoc object.

Definition at line 803 of file DWARFContext.cpp.

References llvm::DWARFUnit::getAddressByteSize(), getNumCompileUnits(), getUnitAtIndex(), and isLittleEndian().

Referenced by dump(), and setMaxVersionIfGreater().

◆ getDebugMacinfo()

const DWARFDebugMacro * DWARFContext::getDebugMacinfo ( )

Get a pointer to the parsed DebugMacinfo information object.

Definition at line 875 of file DWARFContext.cpp.

Referenced by dump(), and setMaxVersionIfGreater().

◆ getDebugMacinfoDWO()

const DWARFDebugMacro * DWARFContext::getDebugMacinfoDWO ( )

Get a pointer to the parsed DebugMacinfoDWO information object.

Definition at line 881 of file DWARFContext.cpp.

Referenced by dump(), and setMaxVersionIfGreater().

◆ getDebugMacro()

const DWARFDebugMacro * DWARFContext::getDebugMacro ( )

Get a pointer to the parsed DebugMacro information object.

Definition at line 863 of file DWARFContext.cpp.

Referenced by dump(), and setMaxVersionIfGreater().

◆ getDebugMacroDWO()

const DWARFDebugMacro * DWARFContext::getDebugMacroDWO ( )

Get a pointer to the parsed DebugMacroDWO information object.

Definition at line 869 of file DWARFContext.cpp.

Referenced by dump(), and setMaxVersionIfGreater().

◆ getDebugNames()

const DWARFDebugNames & DWARFContext::getDebugNames ( )

Get a reference to the parsed accelerator table object.

Definition at line 901 of file DWARFContext.cpp.

References getAccelTable(), and isLittleEndian().

Referenced by dump(), and setMaxVersionIfGreater().

◆ getDIEForOffset()

DWARFDie DWARFContext::getDIEForOffset ( uint64_t  Offset)

Get a DIE given an exact offset.

Definition at line 730 of file DWARFContext.cpp.

References llvm::DWARFUnitVector::getUnitForOffset().

Referenced by getDWOUnitAtIndex(), and llvm::DWARFVerifier::handleDebugLine().

◆ getDIEsForAddress()

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

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"

Definition at line 1004 of file DWARFContext.cpp.

References llvm::DWARFDie::addressRangeContainsAddress(), llvm::DWARFContext::DIEsForAddress::BlockDIE, llvm::DWARFContext::DIEsForAddress::CompileUnit, llvm::DWARFContext::DIEsForAddress::FunctionDIE, getCompileUnitForAddress(), llvm::DWARFUnit::getSubroutineForAddress(), llvm::DWARFDie::getTag(), and llvm::DWARFDie::isValid().

Referenced by llvm::DWARFContext::DIEsForAddress::operator bool().

◆ getDWARFObj()

const DWARFObject& llvm::DWARFContext::getDWARFObj ( ) const
inline

◆ getDWOCompileUnitForHash()

DWARFCompileUnit * DWARFContext::getDWOCompileUnitForHash ( uint64_t  Hash)

◆ getDWOContext()

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

◆ getDWOUnitAtIndex()

DWARFUnit* llvm::DWARFContext::getDWOUnitAtIndex ( unsigned  index)
inline

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

Definition at line 234 of file DWARFContext.h.

References getCompileUnitForOffset(), getDIEForOffset(), and getDWOCompileUnitForHash().

◆ getEHFrame()

Expected< const DWARFDebugFrame * > DWARFContext::getEHFrame ( )

Get a pointer to the parsed eh frame information object.

Definition at line 849 of file DWARFContext.cpp.

References DF, E, getArch(), and isLittleEndian().

Referenced by dump(), and setMaxVersionIfGreater().

◆ getGdbIndex()

DWARFGdbIndex & DWARFContext::getGdbIndex ( )

Definition at line 772 of file DWARFContext.cpp.

Referenced by dump(), and setMaxVersionIfGreater().

◆ getInliningInfoForAddress()

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

◆ getLineInfoForAddress()

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

◆ getLineInfoForAddressRange()

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

◆ getLineStringExtractor()

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

Definition at line 329 of file DWARFContext.h.

◆ getLineTableForUnit() [1/2]

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

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

Report any parsing issues as warnings on stderr.

Definition at line 928 of file DWARFContext.cpp.

References llvm::Expected< T >::takeError().

Referenced by llvm::gsym::CUInfo::CUInfo(), dumpAttribute(), llvm::DeclContextTree::getChildDeclContext(), getInliningInfoForAddress(), getLineInfoForAddress(), getLineInfoForAddressRange(), and setMaxVersionIfGreater().

◆ getLineTableForUnit() [2/2]

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

◆ getLocalsForAddress()

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

◆ getMaxDWOVersion()

unsigned llvm::DWARFContext::getMaxDWOVersion ( )
inline

Definition at line 253 of file DWARFContext.h.

References dwo_info_section_units().

◆ getMaxVersion()

unsigned llvm::DWARFContext::getMaxVersion ( )
inline

Definition at line 247 of file DWARFContext.h.

References info_section_units().

Referenced by dump().

◆ getNumCompileUnits()

unsigned llvm::DWARFContext::getNumCompileUnits ( )
inline

Get the number of compile units in this context.

Definition at line 204 of file DWARFContext.h.

References llvm::DWARFUnitVector::getNumInfoUnits().

Referenced by dump(), getDebugLoc(), and llvm::DWARFVerifier::handleDebugLine().

◆ getNumDWOCompileUnits()

unsigned llvm::DWARFContext::getNumDWOCompileUnits ( )
inline

Get the number of compile units in the DWO context.

Definition at line 216 of file DWARFContext.h.

References llvm::DWARFUnitVector::getNumInfoUnits().

Referenced by dump().

◆ getNumDWOTypeUnits()

unsigned llvm::DWARFContext::getNumDWOTypeUnits ( )
inline

Get the number of type units in the DWO context.

Definition at line 222 of file DWARFContext.h.

References llvm::DWARFUnitVector::getNumTypesUnits().

Referenced by dump().

◆ getNumTypeUnits()

unsigned llvm::DWARFContext::getNumTypeUnits ( )
inline

Get the number of type units in this context.

Definition at line 210 of file DWARFContext.h.

References llvm::DWARFUnitVector::getNumTypesUnits().

Referenced by dump().

◆ getRecoverableErrorHandler()

function_ref<void(Error)> llvm::DWARFContext::getRecoverableErrorHandler ( )
inline

◆ getRegisterInfo()

const MCRegisterInfo* llvm::DWARFContext::getRegisterInfo ( ) const
inline

Definition at line 371 of file DWARFContext.h.

References llvm::MCRegisterInfo::get().

Referenced by dump(), and dumpLocation().

◆ getStringDWOExtractor()

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

Definition at line 326 of file DWARFContext.h.

◆ getStringExtractor()

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

Definition at line 323 of file DWARFContext.h.

◆ getTUIndex()

const DWARFUnitIndex & DWARFContext::getTUIndex ( )

◆ getUnitAtIndex()

DWARFUnit* llvm::DWARFContext::getUnitAtIndex ( unsigned  index)
inline

Get the unit at the specified index.

Definition at line 228 of file DWARFContext.h.

Referenced by getDebugLoc().

◆ getWarningHandler()

function_ref<void(Error)> llvm::DWARFContext::getWarningHandler ( )
inline

◆ info_section_units()

unit_iterator_range llvm::DWARFContext::info_section_units ( )
inline

◆ isAddressSizeSupported()

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

Definition at line 365 of file DWARFContext.h.

References getDWOContext().

Referenced by llvm::DWARFVerifier::DieRangeInfo::intersects().

◆ isLittleEndian()

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

◆ isSupportedVersion()

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

Definition at line 361 of file DWARFContext.h.

Referenced by llvm::DWARFVerifier::DieRangeInfo::intersects().

◆ loadRegisterInfo()

Error DWARFContext::loadRegisterInfo ( const object::ObjectFile Obj)

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.

Definition at line 1969 of file DWARFContext.cpp.

References llvm::Target::createMCRegInfo(), llvm::createStringError(), llvm::object::ObjectFile::getArch(), llvm::invalid_argument, llvm::TargetRegistry::lookupTarget(), llvm::Triple::setArch(), llvm::Triple::setOS(), llvm::Triple::setVendor(), llvm::Triple::str(), llvm::Error::success(), llvm::Triple::UnknownOS, and llvm::Triple::UnknownVendor.

Referenced by getWarningHandler().

◆ normal_units()

unit_iterator_range llvm::DWARFContext::normal_units ( )
inline

Get all normal compile/type units in this context.

Definition at line 172 of file DWARFContext.h.

References llvm::SmallVectorTemplateCommon< T, typename >::begin(), and llvm::SmallVectorTemplateCommon< T, typename >::end().

Referenced by dump().

◆ operator=()

DWARFContext& llvm::DWARFContext::operator= ( DWARFContext )
delete

◆ setMaxVersionIfGreater()

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

◆ type_units()

unit_iterator_range llvm::DWARFContext::type_units ( )
inline

Get type units in this context.

Definition at line 169 of file DWARFContext.h.

References types_section_units().

Referenced by dump().

◆ types_section_units()

unit_iterator_range llvm::DWARFContext::types_section_units ( )
inline

◆ verify()

bool DWARFContext::verify ( raw_ostream OS,
DIDumpOptions  DumpOpts = {} 
)
overridevirtual

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