LLVM 20.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 | |
Error | extract (DWARFContext &Context, const DWARFDataExtractor &debug_info, uint64_t *offset_ptr, DWARFSectionKind SectionKind) |
Parse a unit header from debug_info starting at offset_ptr . | |
Error | 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 55 of file DWARFUnit.h.
Error DWARFUnitHeader::applyIndexEntry | ( | const DWARFUnitIndex::Entry * | Entry | ) |
Definition at line 341 of file DWARFUnit.cpp.
References assert(), llvm::createStringError(), llvm::DWARFUnitIndex::Entry::getContribution(), getLength(), getUnitLengthFieldByteSize(), llvm::invalid_argument, and llvm::Error::success().
Error 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 254 of file DWARFUnit.cpp.
References llvm::dwarf::FormParams::AddrSize, assert(), llvm::DWARFContext::checkAddressSizeSupported(), 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::DWARFContext::setMaxVersionIfGreater(), llvm::DataExtractor::size(), llvm::Error::success(), and llvm::dwarf::FormParams::Version.
|
inline |
Definition at line 99 of file DWARFUnit.h.
|
inline |
Definition at line 93 of file DWARFUnit.h.
References llvm::dwarf::FormParams::AddrSize.
Referenced by extract().
|
inline |
Definition at line 95 of file DWARFUnit.h.
References llvm::dwarf::FormParams::getDwarfOffsetByteSize().
|
inline |
Definition at line 100 of file DWARFUnit.h.
Referenced by llvm::DWARFUnit::getDWOId().
|
inline |
Definition at line 92 of file DWARFUnit.h.
References llvm::dwarf::FormParams::Format.
|
inline |
Definition at line 90 of file DWARFUnit.h.
|
inline |
Definition at line 105 of file DWARFUnit.h.
|
inline |
Definition at line 98 of file DWARFUnit.h.
References llvm::Length.
Referenced by applyIndexEntry(), and extract().
|
inline |
Definition at line 116 of file DWARFUnit.h.
References getUnitLengthFieldByteSize(), and llvm::Length.
Referenced by extract().
|
inline |
Definition at line 89 of file DWARFUnit.h.
|
inline |
Definition at line 94 of file DWARFUnit.h.
References llvm::dwarf::FormParams::getRefAddrByteSize().
|
inline |
Definition at line 112 of file DWARFUnit.h.
|
inline |
Definition at line 106 of file DWARFUnit.h.
Referenced by llvm::DWARFTypeUnit::getTypeHash().
|
inline |
Definition at line 107 of file DWARFUnit.h.
Referenced by llvm::DWARFTypeUnit::getTypeOffset().
|
inline |
Definition at line 113 of file DWARFUnit.h.
References llvm::dwarf::FormParams::Format, and llvm::dwarf::getUnitLengthFieldByteSize().
Referenced by applyIndexEntry(), extract(), and getNextUnitOffset().
|
inline |
Definition at line 108 of file DWARFUnit.h.
|
inline |
Definition at line 91 of file DWARFUnit.h.
References llvm::dwarf::FormParams::Version.
Referenced by extract().
|
inline |
Definition at line 109 of file DWARFUnit.h.
Referenced by extract().
|
inline |
Definition at line 101 of file DWARFUnit.h.
References assert().