LLVM 18.0.0git
|
Base class describing the header of any kind of "unit." Some information is specific to certain unit types. More...
#include "llvm/DebugInfo/DWARF/DWARFUnit.h"
Public Member Functions | |
bool | extract (DWARFContext &Context, const DWARFDataExtractor &debug_info, uint64_t *offset_ptr, DWARFSectionKind SectionKind) |
Parse a unit header from debug_info starting at offset_ptr . | |
bool | applyIndexEntry (const DWARFUnitIndex::Entry *Entry) |
uint64_t | getOffset () const |
const dwarf::FormParams & | getFormParams () const |
uint16_t | getVersion () const |
dwarf::DwarfFormat | getFormat () const |
uint8_t | getAddressByteSize () const |
uint8_t | getRefAddrByteSize () const |
uint8_t | getDwarfOffsetByteSize () const |
uint64_t | getLength () const |
uint64_t | getAbbrOffset () const |
std::optional< uint64_t > | getDWOId () const |
void | setDWOId (uint64_t Id) |
const DWARFUnitIndex::Entry * | getIndexEntry () const |
uint64_t | getTypeHash () const |
uint64_t | getTypeOffset () const |
uint8_t | getUnitType () const |
bool | isTypeUnit () const |
uint8_t | getSize () const |
uint8_t | getUnitLengthFieldByteSize () const |
uint64_t | getNextUnitOffset () const |
Base class describing the header of any kind of "unit." Some information is specific to certain unit types.
We separate this class out so we can parse the header before deciding what specific kind of unit to construct.
Definition at line 53 of file DWARFUnit.h.
bool DWARFUnitHeader::applyIndexEntry | ( | const DWARFUnitIndex::Entry * | Entry | ) |
Definition at line 348 of file DWARFUnit.cpp.
References assert(), llvm::DWARFUnitIndex::Entry::getContribution(), getLength(), and getUnitLengthFieldByteSize().
bool DWARFUnitHeader::extract | ( | DWARFContext & | Context, |
const DWARFDataExtractor & | debug_info, | ||
uint64_t * | offset_ptr, | ||
DWARFSectionKind | SectionKind | ||
) |
Parse a unit header from debug_info
starting at offset_ptr
.
Note that SectionKind
is used as a hint to guess the unit type for DWARF formats prior to DWARFv5. In DWARFv5 the unit type is explicitly defined in the header and the hint is ignored.
Definition at line 247 of file DWARFUnit.cpp.
References llvm::dwarf::FormParams::AddrSize, assert(), llvm::DWARFContext::checkAddressSizeSupported(), Context, llvm::createStringError(), llvm::DW_SECT_EXT_TYPES, llvm::dwarf::FormParams::Format, getAddressByteSize(), llvm::dwarf::FormParams::getDwarfOffsetByteSize(), llvm::DWARFDataExtractor::getInitialLength(), getLength(), llvm::DWARFContext::getMaxSupportedVersion(), getNextUnitOffset(), llvm::DWARFDataExtractor::getRelocatedValue(), llvm::DataExtractor::getU16(), llvm::DataExtractor::getU64(), llvm::DataExtractor::getU8(), getUnitLengthFieldByteSize(), llvm::DataExtractor::getUnsigned(), getVersion(), llvm::invalid_argument, llvm::DWARFContext::isSupportedVersion(), isTypeUnit(), llvm::DataExtractor::isValidOffset(), llvm::joinErrors(), llvm::DataExtractor::size(), llvm::Error::success(), and llvm::dwarf::FormParams::Version.
|
inline |
Definition at line 97 of file DWARFUnit.h.
|
inline |
Definition at line 91 of file DWARFUnit.h.
References llvm::dwarf::FormParams::AddrSize.
Referenced by extract().
|
inline |
Definition at line 93 of file DWARFUnit.h.
References llvm::dwarf::FormParams::getDwarfOffsetByteSize().
|
inline |
Definition at line 98 of file DWARFUnit.h.
Referenced by llvm::DWARFUnit::getDWOId().
|
inline |
Definition at line 90 of file DWARFUnit.h.
References llvm::dwarf::FormParams::Format.
|
inline |
Definition at line 88 of file DWARFUnit.h.
|
inline |
Definition at line 103 of file DWARFUnit.h.
|
inline |
Definition at line 96 of file DWARFUnit.h.
References llvm::Length.
Referenced by applyIndexEntry(), and extract().
|
inline |
Definition at line 114 of file DWARFUnit.h.
References getUnitLengthFieldByteSize(), and llvm::Length.
Referenced by extract().
|
inline |
Definition at line 87 of file DWARFUnit.h.
|
inline |
Definition at line 92 of file DWARFUnit.h.
References llvm::dwarf::FormParams::getRefAddrByteSize().
|
inline |
Definition at line 110 of file DWARFUnit.h.
|
inline |
Definition at line 104 of file DWARFUnit.h.
Referenced by llvm::DWARFTypeUnit::getTypeHash().
|
inline |
Definition at line 105 of file DWARFUnit.h.
Referenced by llvm::DWARFTypeUnit::getTypeOffset().
|
inline |
Definition at line 111 of file DWARFUnit.h.
References llvm::dwarf::FormParams::Format, and llvm::dwarf::getUnitLengthFieldByteSize().
Referenced by applyIndexEntry(), extract(), and getNextUnitOffset().
|
inline |
Definition at line 106 of file DWARFUnit.h.
|
inline |
Definition at line 89 of file DWARFUnit.h.
References llvm::dwarf::FormParams::Version.
Referenced by extract().
|
inline |
Definition at line 107 of file DWARFUnit.h.
Referenced by extract().
|
inline |
Definition at line 99 of file DWARFUnit.h.
References assert().