LLVM: llvm::DWARFUnit Class Reference (original ) (raw )#include "[llvm/DebugInfo/DWARF/DWARFUnit.h](DWARFUnit%5F8h%5Fsource.html)"
Public Member Functions
DWARFUnit (DWARFContext &Context , const DWARFSection &Section, const DWARFUnitHeader &Header, const DWARFDebugAbbrev *DA, const DWARFSection *RS, const DWARFSection *LocSection, StringRef SS, const DWARFSection &SOS, const DWARFSection *AOS, const DWARFSection &LS, bool LE, bool IsDWO, const DWARFUnitVector &UnitVector)
virtual
~DWARFUnit ()
bool
isLittleEndian () const
bool
isDWOUnit () const
DWARFContext &
getContext () const
const DWARFSection &
getInfoSection () const
uint64_t
getOffset () const
const dwarf::FormParams &
getFormParams () const
uint16_t
getVersion () const
uint8_t
getAddressByteSize () const
uint8_t
getRefAddrByteSize () const
uint8_t
getDwarfOffsetByteSize () const
uint32_t
getHeaderSize () const
Size in bytes of the parsed unit header.
uint64_t
getLength () const
dwarf::DwarfFormat
getFormat () const
uint8_t
getUnitType () const
bool
isTypeUnit () const
uint64_t
getAbbrOffset () const
uint64_t
getNextUnitOffset () const
const DWARFSection &
getLineSection () const
StringRef
getStringSection () const
const DWARFSection &
getStringOffsetSection () const
void
setSkeletonUnit (DWARFUnit *SU)
DWARFUnit *
getLinkedUnit ()
void
setAddrOffsetSection (const DWARFSection *AOS, uint64_t Base )
std::optional< uint64_t >
getAddrOffsetSectionBase () const
std::optional< uint64_t >
getIndexedAddressOffset (uint64_t Index)
Returns offset to the indexed address value inside .debug_addr section.
void
updateAddressDieMap (DWARFDie Die)
Recursively update address to Die map.
void
updateVariableDieMap (DWARFDie Die)
Recursively update address to variable Die map.
void
setRangesSection (const DWARFSection *RS, uint64_t Base )
uint64_t
getLocSectionBase () const
std::optional< object::SectionedAddress >
getAddrOffsetSectionItem (uint32_t Index ) const
Expected < uint64_t >
getStringOffsetSectionItem (uint32_t Index ) const
DWARFDataExtractor
getDebugInfoExtractor () const
DataExtractor
getStringExtractor () const
const DWARFLocationTable &
getLocationTable ()
Error
extractRangeList (uint64_t RangeListOffset, DWARFDebugRangeList &RangeList) const
Extract the range list referenced by this compile unit from the .debug_ranges section.
void
clear ()
const std::optional< StrOffsetsContributionDescriptor > &
getStringOffsetsTableContribution ()
uint8_t
getDwarfStringOffsetsByteSize () const
uint64_t
getStringOffsetsBase () const
uint64_t
getAbbreviationsOffset () const
const DWARFAbbreviationDeclarationSet *
getAbbreviations () const
std::optional< object::SectionedAddress >
getBaseAddress ()
DWARFDie
getUnitDIE (bool ExtractUnitDIEOnly=true)
DWARFDie
getNonSkeletonUnitDIE (bool ExtractUnitDIEOnly=true, StringRef DWOAlternativeLocation={})
const char *
getCompilationDir ()
std::optional< uint64_t >
getDWOId ()
void
setDWOId (uint64_t NewID)
Expected < DWARFAddressRangesVector >
findRnglistFromOffset (uint64_t Offset )
Return a vector of address ranges resulting from a (possibly encoded) range list starting at a given offset in the appropriate ranges section.
Expected < DWARFAddressRangesVector >
findRnglistFromIndex (uint32_t Index )
Return a vector of address ranges retrieved from an encoded range list whose offset is found via a table lookup given an index (DWARF v5 and later).
std::optional< uint64_t >
getRnglistOffset (uint32_t Index )
Return a rangelist's offset based on an index.
std::optional< uint64_t >
getLoclistOffset (uint32_t Index )
Expected < DWARFAddressRangesVector >
collectAddressRanges ()
Expected < DWARFLocationExpressionsVector >
findLoclistFromOffset (uint64_t Offset )
DWARFDie
getSubroutineForAddress (uint64_t Address )
Returns subprogram DIE with address range encompassing the provided address.
DWARFDie
getVariableForAddress (uint64_t Address )
Returns variable DIE for the address provided.
void
getInlinedChainForAddress (uint64_t Address , SmallVectorImpl < DWARFDie > &InlinedChain)
getInlinedChainForAddress - fetches inlined chain for a given address.
const DWARFUnitVector &
getUnitVector () const
Return the DWARFUnitVector containing this unit.
unsigned
getNumDIEs ()
Returns the number of DIEs in the unit.
uint32_t
getDIEIndex (const DWARFDie &D ) const
Return the index of a DIE inside the unit's DIE vector.
DWARFDie
getDIEAtIndex (unsigned Index)
Return the DIE object at the given index Index.
DWARFDie
getParent (const DWARFDebugInfoEntry *Die)
DWARFDie
getSibling (const DWARFDebugInfoEntry *Die)
DWARFDie
getPreviousSibling (const DWARFDebugInfoEntry *Die)
DWARFDie
getFirstChild (const DWARFDebugInfoEntry *Die)
DWARFDie
getLastChild (const DWARFDebugInfoEntry *Die)
DWARFDie
getDIEForOffset (uint64_t Offset )
Return the DIE object for a given offset Offset inside the unit's DIE vector.
std::optional< uint32_t >
getDIEIndexForOffset (uint64_t Offset )
Return the DIE index for a given offset Offset inside the unit's DIE vector.
uint32_t
getLineTableOffset () const
die_iterator_range
dies ()
virtual void
dump (raw_ostream &OS, DIDumpOptions DumpOpts)=0
Error
tryExtractDIEsIfNeeded (bool CUDieOnly)
Definition at line 218 of file DWARFUnit.h .
DWARFUnit::DWARFUnit
(
DWARFContext &
Context ,
const DWARFSection &
Section ,
const DWARFUnitHeader &
Header ,
const DWARFDebugAbbrev *
DA ,
const DWARFSection *
RS ,
const DWARFSection *
LocSection ,
StringRef
SS ,
const DWARFSection &
SOS ,
const DWARFSection *
AOS ,
const DWARFSection &
LS ,
bool
LE ,
bool
IsDWO ,
const DWARFUnitVector &
UnitVector )
◆ ~DWARFUnit()
DWARFUnit::~DWARFUnit ( )
virtualdefault
◆ clear()
void DWARFUnit::clear
(
)
◆ collectAddressRanges()◆ determineStringOffsetsTableContribution()◆ determineStringOffsetsTableContributionDWO()◆ dies()◆ dump()◆ findLoclistFromOffset()◆ findRnglistFromIndex()◆ findRnglistFromOffset()◆ getAbbreviations()◆ getAbbreviationsOffset()
uint64_t llvm::DWARFUnit::getAbbreviationsOffset ( ) const
inline
◆ getAbbrOffset()
uint64_t llvm::DWARFUnit::getAbbrOffset ( ) const
inline
◆ getAddressByteSize()
uint8_t llvm::DWARFUnit::getAddressByteSize ( ) const
inline
◆ getAddrOffsetSectionBase()
std::optional< uint64_t > llvm::DWARFUnit::getAddrOffsetSectionBase ( ) const
inline
◆ getAddrOffsetSectionItem()◆ getBaseAddress()◆ getCompilationDir()
const char * DWARFUnit::getCompilationDir
(
)
◆ getContext()◆ getDebugInfoEntry()◆ getDIEAtIndex()◆ getDIEForOffset()◆ getDIEIndex() [1/2]Return the index of a Die entry inside the unit's DIE vector.
It is illegal to call this method with a DIE that hasn't be created by this unit. In other word, it's illegal to call this method on a DIE that isn't accessible by following children/sibling links starting from this unit's getUnitDIE() .
Definition at line 276 of file DWARFUnit.h .
References assert() , and llvm::First .
Referenced by getDIEIndex() , llvm::dwarf_linker::parallel::CompileUnit::getDIEInfo() , llvm::dwarf_linker::parallel::CompileUnit::getDIEInfo() , llvm::dwarf_linker::parallel::CompileUnit::getDIEInfo() , llvm::dwarf_linker::parallel::CompileUnit::getDIEInfo() , llvm::dwarf_linker::parallel::CompileUnit::getDieOutOffset() , llvm::dwarf_linker::parallel::CompileUnit::getDieTypeEntry() , getFirstChildEntry() , llvm::dwarf_linker::classic::CompileUnit::getInfo() , getLastChildEntry() , getPreviousSiblingEntry() , llvm::dwarf_linker::parallel::CompileUnit::setDieTypeEntry() , and llvm::dwarf_linker::classic::DeclContext::setLastSeenDIE() .
◆ getDIEIndex() [2/2]Return the index of a DIE inside the unit's DIE vector.
It is illegal to call this method with a DIE that hasn't be created by this unit. In other word, it's illegal to call this method on a DIE that isn't accessible by following children/sibling links starting from this unit's getUnitDIE() .
Definition at line 523 of file DWARFUnit.h .
References D() , and getDIEIndex() .
◆ getDIEIndexForOffset()
std::optional< uint32_t > llvm::DWARFUnit::getDIEIndexForOffset ( uint64_t Offset )
inline
◆ getDwarfOffsetByteSize()
uint8_t llvm::DWARFUnit::getDwarfOffsetByteSize ( ) const
inline
◆ getDwarfStringOffsetsByteSize()
uint8_t llvm::DWARFUnit::getDwarfStringOffsetsByteSize ( ) const
inline
◆ getDWOId()
std::optional< uint64_t > llvm::DWARFUnit::getDWOId ( )
inline
◆ getFirstChild()◆ getFirstChildEntry()
uint32_t llvm::DWARFUnit::getHeaderSize ( ) const
inline
Size in bytes of the parsed unit header.
Definition at line 339 of file DWARFUnit.h .
◆ getIndexedAddressOffset()
std::optional< uint64_t > llvm::DWARFUnit::getIndexedAddressOffset ( uint64_t Index )
inline
◆ getInfoSection()◆ getInlinedChainForAddress()◆ getLastChild()◆ getLastChildEntry()◆ getLength()
uint64_t llvm::DWARFUnit::getLength ( ) const
inline
◆ getLineSection()◆ getLineTableOffset()
uint32_t llvm::DWARFUnit::getLineTableOffset ( ) const
inline
◆ getLinkedUnit()
DWARFUnit * llvm::DWARFUnit::getLinkedUnit ( )
inline
◆ getLocationTable()◆ getLoclistOffset()◆ getLocSectionBase()
uint64_t llvm::DWARFUnit::getLocSectionBase ( ) const
inline
◆ getNextUnitOffset()
uint64_t llvm::DWARFUnit::getNextUnitOffset ( ) const
inline
◆ getNonSkeletonUnitDIE()
DWARFDie llvm::DWARFUnit::getNonSkeletonUnitDIE ( bool ExtractUnitDIEOnly = true, StringRef DWOAlternativeLocation = {} )
inline
◆ getNumDIEs()
unsigned llvm::DWARFUnit::getNumDIEs ( )
inline
Returns the number of DIEs in the unit.
Parses the unit if necessary.
Definition at line 512 of file DWARFUnit.h .
◆ getOffset()
uint64_t llvm::DWARFUnit::getOffset ( ) const
inline
◆ getParent()◆ getParentEntry()◆ getPreviousSibling()◆ getPreviousSiblingEntry()◆ getRefAddrByteSize()
uint8_t llvm::DWARFUnit::getRefAddrByteSize ( ) const
inline
◆ getRnglistOffset()◆ getSibling()◆ getSiblingEntry()
DataExtractor llvm::DWARFUnit::getStringExtractor ( ) const
inline
◆ getStringOffsetsBase()
uint64_t llvm::DWARFUnit::getStringOffsetsBase ( ) const
inline
◆ getStringOffsetSection()◆ getStringOffsetSectionItem()◆ getStringOffsetsTableContribution()◆ getStringSection()
StringRef llvm::DWARFUnit::getStringSection ( ) const
inline
◆ getSubroutineForAddress()◆ getUnitDIE()
DWARFDie llvm::DWARFUnit::getUnitDIE ( bool ExtractUnitDIEOnly = true)
inline
Definition at line 450 of file DWARFUnit.h .
Referenced by llvm::dwarf_linker::parallel::CompileUnit::cloneAndEmit() , collectAddressRanges() , llvm::gsym::DwarfTransformer::convert() , determineStringOffsetsTableContribution() , llvm::DWARFCompileUnit::dump() , llvm::DWARFTypeUnit::dump() , getBaseAddress() , getCompilationDir() , llvm::dwarf_linker::classic::CompileUnit::getLanguage() , getLastChildEntry() , getSubroutineForAddress() , llvm::dwarf_linker::classic::CompileUnit::getSysRoot() , and getVariableForAddress() .
◆ getUnitType()
uint8_t llvm::DWARFUnit::getUnitType ( ) const
inline
◆ getUnitVector()◆ getVariableForAddress()◆ getVersion()
uint16_t llvm::DWARFUnit::getVersion ( ) const
inline
◆ isDWOUnit()
bool llvm::DWARFUnit::isDWOUnit ( ) const
inline
◆ isLittleEndian()
bool llvm::DWARFUnit::isLittleEndian ( ) const
inline
◆ isMatchingUnitTypeAndTag()◆ isTypeUnit()
bool llvm::DWARFUnit::isTypeUnit ( ) const
inline
◆ setAddrOffsetSection()◆ setDWOId()
void llvm::DWARFUnit::setDWOId ( uint64_t NewID )
inline
◆ setRangesSection()◆ setSkeletonUnit()
void llvm::DWARFUnit::setSkeletonUnit ( DWARFUnit * SU )
inline
Error DWARFUnit::tryExtractDIEsIfNeeded
(
bool
CUDieOnly
)
Definition at line 506 of file DWARFUnit.cpp .
References assert() , llvm::CallingConv::C , llvm::createStringError() , llvm::Data , determineStringOffsetsTableContribution() , determineStringOffsetsTableContributionDWO() , llvm::DW_SECT_EXT_LOC , llvm::DWARFDie::find() , getAddressByteSize() , llvm::DWARFListTableHeader::getHeaderSize() , getVersion() , llvm::invalid_argument , setRangesSection() , llvm::Error::success() , llvm::dwarf::toSectionOffset() , llvm::toString() , and llvm::dwarf::toUnsigned() .
Referenced by dump() .
◆ updateAddressDieMap()
void DWARFUnit::updateAddressDieMap
(
DWARFDie
Die
)
◆ updateVariableDieMap()
void DWARFUnit::updateVariableDieMap
(
DWARFDie
Die
)
Recursively update address to variable Die map.
Definition at line 784 of file DWARFUnit.cpp .
References llvm::Address , llvm::DWARFExpression::begin() , llvm::consumeError() , llvm::Data , llvm::DWARFExpression::end() , getAddressByteSize() , getAddrOffsetSectionItem() , llvm::DWARFDie::getAttributeValueAsReferencedDie() , llvm::DWARFDie::getLocations() , llvm::DWARFDie::getTag() , llvm::DWARFDie::getTypeSize() , isLittleEndian() , llvm::dwarf::isType() , Size , UINT64_MAX , and updateVariableDieMap() .
Referenced by getVariableForAddress() , and updateVariableDieMap() .
The documentation for this class was generated from the following files: