|
LLVM
7.0.0
|
#include "llvm/DebugInfo/DWARF/DWARFUnit.h"
Static Public Member Functions | |
| static bool | isMatchingUnitTypeAndTag (uint8_t UnitType, dwarf::Tag Tag) |
| static uint32_t | getDWARF5HeaderSize (uint8_t UnitType) |
| Return the number of bytes for the header of a unit of UnitType type. More... | |
Protected Member Functions | |
| const DWARFUnitHeader & | getHeader () const |
| uint32_t | getHeaderSize () const |
| Size in bytes of the parsed unit header. More... | |
| Optional< StrOffsetsContributionDescriptor > | determineStringOffsetsTableContribution (DWARFDataExtractor &DA, uint64_t Offset) |
| Find the unit's contribution to the string offsets table and determine its length and form. More... | |
| Optional< StrOffsetsContributionDescriptor > | determineStringOffsetsTableContributionDWO (DWARFDataExtractor &DA, uint64_t Offset) |
| Find the unit's contribution to the string offsets table and determine its length and form. More... | |
Definition at line 255 of file DWARFUnit.h.
| DWARFUnit::DWARFUnit | ( | DWARFContext & | Context, |
| const DWARFSection & | Section, | ||
| const DWARFUnitHeader & | Header, | ||
| const DWARFDebugAbbrev * | DA, | ||
| const DWARFSection * | RS, | ||
| StringRef | SS, | ||
| const DWARFSection & | SOS, | ||
| const DWARFSection * | AOS, | ||
| const DWARFSection & | LS, | ||
| bool | LE, | ||
| bool | IsDWO, | ||
| const DWARFUnitSectionBase & | UnitSection | ||
| ) |
Definition at line 51 of file DWARFUnit.cpp.
References clear(), and ~DWARFUnit().
|
virtualdefault |
Referenced by DWARFUnit().
| void DWARFUnit::clear | ( | ) |
Definition at line 194 of file DWARFUnit.cpp.
Referenced by DWARFUnit().
| void DWARFUnit::collectAddressRanges | ( | DWARFAddressRangesVector & | CURanges | ) |
Definition at line 437 of file DWARFUnit.cpp.
References llvm::DWARFDie::collectChildrenAddressRanges(), llvm::WithColor::error(), llvm::DWARFDie::getAddressRanges(), getUnitDIE(), and llvm::toString().
|
protected |
Find the unit's contribution to the string offsets table and determine its length and form.
The given offset is expected to be derived from the unit DIE's DW_AT_str_offsets_base attribute.
Definition at line 704 of file DWARFUnit.cpp.
References parseDWARF32StringOffsetsTableHeader(), parseDWARF64StringOffsetsTableHeader(), and llvm::StrOffsetsContributionDescriptor::validateContributionSize().
Referenced by getCompilationDir().
|
protected |
Find the unit's contribution to the string offsets table and determine its length and form.
The given offset is expected to be 0 in a dwo file or, in a dwp file, the start of the unit's contribution to the string offsets table section (as determined by the index table).
Definition at line 718 of file DWARFUnit.cpp.
References C, llvm::DWARFSection::Data, llvm::DW_SECT_STR_OFFSETS, llvm::dwarf::DWARF32, llvm::DWARFUnitHeader::getIndexEntry(), getVersion(), parseDWARF32StringOffsetsTableHeader(), parseDWARF64StringOffsetsTableHeader(), llvm::StringRef::size(), and llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size.
Referenced by getCompilationDir().
|
inline |
Definition at line 539 of file DWARFUnit.h.
References llvm::DWARFUnitHeader::getLength().
| Error DWARFUnit::extractRangeList | ( | uint32_t | RangeListOffset, |
| DWARFDebugRangeList & | RangeList | ||
| ) | const |
Extract the range list referenced by this compile unit from the .debug_ranges section.
If the extraction is unsuccessful, an error is returned. Successful extraction requires that the compile unit has already been extracted.
Definition at line 184 of file DWARFUnit.cpp.
References assert(), llvm::DWARFDebugRangeList::extract(), getAddressByteSize(), and llvm::DWARFContext::getDWARFObj().
Referenced by findRnglistFromOffset().
| Expected< DWARFAddressRangesVector > DWARFUnit::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).
Definition at line 424 of file DWARFUnit.cpp.
References findRnglistFromOffset(), llvm::format(), getRnglistOffset(), llvm::inconvertibleErrorCode(), and llvm::raw_string_ostream::str().
| Expected< DWARFAddressRangesVector > DWARFUnit::findRnglistFromOffset | ( | uint32_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.
Definition at line 403 of file DWARFUnit.cpp.
References E, extractRangeList(), llvm::DWARFDebugRangeList::getAbsoluteRanges(), getBaseAddress(), llvm::DWARFContext::getDWARFObj(), getVersion(), and llvm::inconvertibleErrorCode().
Referenced by findRnglistFromIndex().
| const DWARFAbbreviationDeclarationSet * DWARFUnit::getAbbreviations | ( | ) | const |
Definition at line 634 of file DWARFUnit.cpp.
References llvm::DWARFDebugAbbrev::getAbbreviationDeclarationSet(), and llvm::DWARFUnitHeader::getAbbrOffset().
Referenced by llvm::DWARFCompileUnit::dump(), llvm::DWARFTypeUnit::dump(), and llvm::DWARFDebugInfoEntry::extractFast().
|
inline |
Definition at line 338 of file DWARFUnit.h.
References llvm::DWARFUnitHeader::getAddressByteSize().
Referenced by llvm::DWARFCompileUnit::dump(), llvm::DWARFTypeUnit::dump(), dumpAttribute(), dumpLocation(), llvm::DWARFUnitHeader::extract(), extractRangeList(), getAddrOffsetSectionItem(), llvm::DWARFAbbreviationDeclaration::getAttributeValue(), getDebugInfoExtractor(), llvm::DWARFContext::getDebugLoc(), llvm::DWARFContext::getDebugLocDWO(), llvm::DWARFContext::getLineTableForUnit(), llvm::DWARFVerifier::handleDebugInfo(), and isVariableIndexable().
Definition at line 71 of file DWARFUnit.cpp.
References llvm::DWARFSection::Data, getAddressByteSize(), llvm::DWARFContext::getDWARFObj(), llvm::DWARFDataExtractor::getRelocatedAddress(), and llvm::StringRef::size().
| llvm::Optional< BaseAddress > DWARFUnit::getBaseAddress | ( | ) |
Definition at line 640 of file DWARFUnit.cpp.
References llvm::DWARFDie::find(), llvm::DWARFFormValue::getSectionIndex(), getUnitDIE(), and llvm::dwarf::toAddress().
Referenced by dumpLocation(), and findRnglistFromOffset().
Definition at line 203 of file DWARFUnit.cpp.
References llvm::sys::path::append(), assert(), C, llvm::DWARFSection::Data, llvm::Depth, determineStringOffsetsTableContribution(), determineStringOffsetsTableContributionDWO(), llvm::DW_SECT_STR_OFFSETS, llvm::WithColor::error(), llvm::DWARFDebugInfoEntry::extractFast(), llvm::DWARFDie::find(), llvm::find(), llvm::format(), llvm::DWARFDebugInfoEntry::getAbbreviationDeclarationPtr(), getDebugInfoExtractor(), llvm::DWARFContext::getDWARFObj(), llvm::DWARFContext::getDWOContext(), getDWOId(), getHeaderSize(), llvm::DWARFUnitHeader::getIndexEntry(), getNextUnitOffset(), getOffset(), llvm::DWARFDie::getRangesBaseAttribute(), llvm::DWARFObject::getRnglistsDWOSection(), llvm::DWARFObject::getRnglistsSection(), getUnitDIE(), getVersion(), llvm::sys::path::is_relative(), parseRngListTableHeader(), llvm::DWARFUnitHeader::setDWOId(), setRangesSection(), llvm::StringRef::size(), llvm::dwarf::toSectionOffset(), llvm::dwarf::toString(), llvm::toString(), llvm::dwarf::toUnsigned(), and llvm::WithColor::warning().
Referenced by dumpAttribute(), llvm::DWARFContext::getInliningInfoForAddress(), llvm::DWARFContext::getLineInfoForAddress(), and llvm::DWARFContext::getLineInfoForAddressRange().
|
inline |
Definition at line 332 of file DWARFUnit.h.
References Context.
Referenced by dumpAttribute(), dumpLocation(), and llvm::DWARFFormValue::extractValue().
| DWARFDataExtractor DWARFUnit::getDebugInfoExtractor | ( | ) | const |
Definition at line 66 of file DWARFUnit.cpp.
References getAddressByteSize(), and llvm::DWARFContext::getDWARFObj().
Referenced by dumpAttribute(), llvm::DWARFDebugInfoEntry::extractFast(), llvm::DWARFAbbreviationDeclaration::getAttributeValue(), and getCompilationDir().
Return the DIE object at the given index.
Definition at line 504 of file DWARFUnit.h.
References assert(), and getParent().
Return the DIE object for a given offset inside the unit's DIE vector.
The unit needs to have its DIEs extracted for this method to work.
Definition at line 519 of file DWARFUnit.h.
References assert(), and llvm::lower_bound().
Referenced by llvm::DWARFTypeUnit::dump().
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 499 of file DWARFUnit.h.
References llvm::DWARFDie::getDebugInfoEntry().
|
inlinestatic |
Return the number of bytes for the header of a unit of UnitType type.
This function must be called with a valid unit type which in DWARF5 is defined as one of the following six types.
Definition at line 421 of file DWARFUnit.h.
References llvm_unreachable.
|
inline |
Definition at line 340 of file DWARFUnit.h.
References llvm::DWARFUnitHeader::getDwarfOffsetByteSize().
Referenced by llvm::DWARFAbbreviationDeclaration::getAttributeValue(), and llvm::StrOffsetsContributionDescriptor::validateContributionSize().
|
inline |
Definition at line 387 of file DWARFUnit.h.
References assert().
Referenced by getStringOffsetSectionItem().
|
inline |
Definition at line 446 of file DWARFUnit.h.
Referenced by llvm::DWARFCompileUnit::dump(), and getCompilationDir().
| DWARFDie DWARFUnit::getFirstChild | ( | const DWARFDebugInfoEntry * | Die | ) |
Definition at line 608 of file DWARFUnit.cpp.
References llvm::DWARFDebugInfoEntry::hasChildren(), and I.
|
inline |
Definition at line 334 of file DWARFUnit.h.
References llvm::DWARFUnitHeader::getFormParams().
Referenced by dumpAttribute(), llvm::DWARFDebugInfoEntry::extractFast(), llvm::DWARFAbbreviationDeclaration::getAttributeValue(), and llvm::DWARFAbbreviationDeclaration::AttributeSpec::getByteSize().
|
inlineprotected |
Definition at line 302 of file DWARFUnit.h.
Referenced by llvm::DWARFTypeUnit::getTypeHash(), and llvm::DWARFTypeUnit::getTypeOffset().
|
inlineprotected |
Size in bytes of the parsed unit header.
Definition at line 305 of file DWARFUnit.h.
References llvm::DWARFUnitHeader::getSize(), llvm::AArch64CC::LE, llvm::AArch64CC::LS, and llvm::ARMBuildAttrs::Section.
Referenced by getCompilationDir().
| void DWARFUnit::getInlinedChainForAddress | ( | uint64_t | Address, |
| SmallVectorImpl< DWARFDie > & | InlinedChain | ||
| ) |
getInlinedChainForAddress - fetches inlined chain for a given address.
Returns empty chain if there is no subprogram containing address. The chain is valid as long as parsed compile unit DIEs are not cleared.
Definition at line 521 of file DWARFUnit.cpp.
References assert(), llvm::SmallVectorBase::empty(), llvm::DWARFDie::getParent(), getSubroutineForAddress(), llvm::DWARFDie::getTag(), llvm::DWARFDie::isSubprogramDIE(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by getFunctionNameAndStartLineForAddress(), and llvm::DWARFContext::getInliningInfoForAddress().
| DWARFDie DWARFUnit::getLastChild | ( | const DWARFDebugInfoEntry * | Die | ) |
Definition at line 619 of file DWARFUnit.cpp.
References assert(), llvm::Depth, llvm::DWARFDebugInfoEntry::getDepth(), llvm::DWARFDebugInfoEntry::hasChildren(), and I.
|
inline |
Definition at line 343 of file DWARFUnit.h.
References llvm::DWARFUnitHeader::getLength().
Referenced by llvm::DWARFCompileUnit::dump(), llvm::DWARFTypeUnit::dump(), and llvm::DWARFUnitHeader::extract().
|
inline |
Definition at line 346 of file DWARFUnit.h.
Referenced by llvm::DWARFContext::getLineTableForUnit().
|
inline |
Definition at line 532 of file DWARFUnit.h.
References llvm::DW_SECT_LINE, and llvm::DWARFUnitHeader::getIndexEntry().
Referenced by llvm::DWARFContext::getLineTableForUnit().
|
inline |
Definition at line 345 of file DWARFUnit.h.
References llvm::DWARFUnitHeader::getNextUnitOffset().
Referenced by llvm::DWARFCompileUnit::dump(), llvm::DWARFTypeUnit::dump(), llvm::DWARFUnitHeader::extract(), llvm::DWARFDebugInfoEntry::extractFast(), getCompilationDir(), and llvm::DWARFVerifier::handleDebugInfo().
|
inline |
Returns the number of DIEs in the unit.
Parses the unit if necessary.
Definition at line 488 of file DWARFUnit.h.
|
inline |
Definition at line 333 of file DWARFUnit.h.
References llvm::DWARFUnitHeader::getOffset().
Referenced by llvm::DWARFCompileUnit::dump(), llvm::DWARFTypeUnit::dump(), getCompilationDir(), getNames(), and isVariableIndexable().
| DWARFDie DWARFUnit::getParent | ( | const DWARFDebugInfoEntry * | Die | ) |
Definition at line 550 of file DWARFUnit.cpp.
References llvm::Depth, llvm::DWARFDebugInfoEntry::getDepth(), getUnitDIE(), and I.
| DWARFDie DWARFUnit::getPreviousSibling | ( | const DWARFDebugInfoEntry * | Die | ) |
Definition at line 589 of file DWARFUnit.cpp.
References llvm::Depth, llvm::DWARFDebugInfoEntry::getDepth(), and I.
|
inline |
Definition at line 339 of file DWARFUnit.h.
References llvm::DWARFUnitHeader::getRefAddrByteSize().
Referenced by llvm::DWARFAbbreviationDeclaration::getAttributeValue().
Return a rangelist's offset based on an index.
The index designates an entry in the rangelist table's offset array and is supplied by DW_FORM_rnglistx.
Definition at line 464 of file DWARFUnit.h.
References llvm::Address, and llvm::None.
Referenced by dumpAttribute(), and findRnglistFromIndex().
| DWARFDie DWARFUnit::getSibling | ( | const DWARFDebugInfoEntry * | Die | ) |
Definition at line 569 of file DWARFUnit.cpp.
References llvm::Depth, llvm::DWARFDebugInfoEntry::getAbbreviationDeclarationPtr(), llvm::DWARFDebugInfoEntry::getDepth(), and I.
|
inline |
Definition at line 370 of file DWARFUnit.h.
References clear().
|
inline |
Definition at line 392 of file DWARFUnit.h.
References assert().
Referenced by getStringOffsetSectionItem().
|
inline |
Definition at line 348 of file DWARFUnit.h.
Definition at line 82 of file DWARFUnit.cpp.
References llvm::DWARFSection::Data, llvm::DWARFContext::getDWARFObj(), getDwarfStringOffsetsByteSize(), llvm::DWARFDataExtractor::getRelocatedValue(), getStringOffsetsBase(), and llvm::StringRef::size().
|
inline |
Definition at line 383 of file DWARFUnit.h.
|
inline |
Definition at line 347 of file DWARFUnit.h.
| DWARFDie DWARFUnit::getSubroutineForAddress | ( | uint64_t | Address | ) |
Returns subprogram DIE with address range encompassing the provided address.
The pointer is alive as long as parsed compile unit DIEs are not cleared.
Definition at line 506 of file DWARFUnit.cpp.
References getUnitDIE(), and updateAddressDieMap().
Referenced by llvm::DWARFContext::getDIEsForAddress(), and getInlinedChainForAddress().
Definition at line 438 of file DWARFUnit.h.
Referenced by collectAddressRanges(), llvm::DWARFCompileUnit::dump(), llvm::DWARFTypeUnit::dump(), getBaseAddress(), getCompilationDir(), llvm::DWARFContext::getLineTableForUnit(), getParent(), and getSubroutineForAddress().
|
inline |
getUnitSection - Return the DWARFUnitSection containing this unit.
Definition at line 484 of file DWARFUnit.h.
|
inline |
Definition at line 344 of file DWARFUnit.h.
References llvm::DWARFUnitHeader::getUnitType().
Referenced by llvm::DWARFCompileUnit::dump(), and llvm::DWARFTypeUnit::dump().
|
inline |
Definition at line 337 of file DWARFUnit.h.
References llvm::DWARFUnitHeader::getVersion().
Referenced by determineStringOffsetsTableContributionDWO(), llvm::DWARFCompileUnit::dump(), llvm::DWARFTypeUnit::dump(), dumpLocation(), llvm::DWARFUnitHeader::extract(), findRnglistFromOffset(), getCompilationDir(), llvm::DWARFVerifier::handleDebugInfo(), and isVariableIndexable().
|
inlinestatic |
Definition at line 399 of file DWARFUnit.h.
References llvm::dwarf::isUnitType().
|
inline |
Definition at line 352 of file DWARFUnit.h.
|
inline |
Definition at line 450 of file DWARFUnit.h.
References llvm::DWARFUnitHeader::setDWOId().
|
inline |
| void DWARFUnit::updateAddressDieMap | ( | DWARFDie | Die | ) |
Recursively update address to Die map.
Definition at line 475 of file DWARFUnit.cpp.
References B, llvm::consumeError(), llvm::DWARFDie::getAddressRanges(), llvm::DWARFDie::getFirstChild(), llvm::DWARFDie::getSibling(), llvm::DWARFDie::isSubroutineDIE(), and second.
Referenced by getSubroutineForAddress().
1.8.13