LLVM 20.0.0git
|
A class representing an address table as specified in DWARF v5. More...
#include "llvm/DebugInfo/DWARF/DWARFDebugAddr.h"
Public Member Functions | |
Error | extract (const DWARFDataExtractor &Data, uint64_t *OffsetPtr, uint16_t CUVersion, uint8_t CUAddrSize, std::function< void(Error)> WarnCallback) |
Extract the entire table, including all addresses. | |
Error | extractV5 (const DWARFDataExtractor &Data, uint64_t *OffsetPtr, uint8_t CUAddrSize, std::function< void(Error)> WarnCallback) |
Extract a DWARFv5 address table. | |
Error | extractPreStandard (const DWARFDataExtractor &Data, uint64_t *OffsetPtr, uint16_t CUVersion, uint8_t CUAddrSize) |
Extract a pre-DWARFv5 address table. | |
void | dump (raw_ostream &OS, DIDumpOptions DumpOpts={}) const |
Expected< uint64_t > | getAddrEntry (uint32_t Index) const |
Return the address based on a given index. | |
std::optional< uint64_t > | getFullLength () const |
Return the full length of this table, including the length field. | |
dwarf::DwarfFormat | getFormat () const |
Return the DWARF format of this table. | |
uint64_t | getLength () const |
Return the length of this table. | |
uint16_t | getVersion () const |
Return the version of this table. | |
uint8_t | getAddressSize () const |
Return the address size of this table. | |
uint8_t | getSegmentSelectorSize () const |
Return the segment selector size of this table. | |
ArrayRef< uint64_t > | getAddressEntries () const |
Return the parsed addresses of this table. | |
A class representing an address table as specified in DWARF v5.
The table consists of a header followed by an array of address values from .debug_addr section.
Definition at line 26 of file DWARFDebugAddr.h.
void DWARFDebugAddrTable::dump | ( | raw_ostream & | OS, |
DIDumpOptions | DumpOpts = {} |
||
) | const |
Definition at line 136 of file DWARFDebugAddr.cpp.
References Addr, llvm::format(), llvm::dwarf::FormatString(), llvm::dwarf::getDwarfOffsetByteSize(), llvm_unreachable, OS, and llvm::DIDumpOptions::Verbose.
Referenced by dumpAddrSection().
Error DWARFDebugAddrTable::extract | ( | const DWARFDataExtractor & | Data, |
uint64_t * | OffsetPtr, | ||
uint16_t | CUVersion, | ||
uint8_t | CUAddrSize, | ||
std::function< void(Error)> | WarnCallback | ||
) |
Extract the entire table, including all addresses.
Definition at line 122 of file DWARFDebugAddr.cpp.
References llvm::createStringError(), llvm::Data, extractPreStandard(), extractV5(), and llvm::invalid_argument.
Referenced by dumpAddrSection().
Error DWARFDebugAddrTable::extractPreStandard | ( | const DWARFDataExtractor & | Data, |
uint64_t * | OffsetPtr, | ||
uint16_t | CUVersion, | ||
uint8_t | CUAddrSize | ||
) |
Extract a pre-DWARFv5 address table.
Such tables do not have a header and consist only of a series of addresses. See https://gcc.gnu.org/wiki/DebugFission for details.
Definition at line 107 of file DWARFDebugAddr.cpp.
References assert(), and llvm::Data.
Referenced by extract().
Error DWARFDebugAddrTable::extractV5 | ( | const DWARFDataExtractor & | Data, |
uint64_t * | OffsetPtr, | ||
uint8_t | CUAddrSize, | ||
std::function< void(Error)> | WarnCallback | ||
) |
Extract a DWARFv5 address table.
Definition at line 42 of file DWARFDebugAddr.cpp.
References llvm::c_str(), llvm::createStringError(), llvm::Data, llvm::invalid_argument, llvm::Length, llvm::not_supported, llvm::Error::success(), and llvm::dwarf::toString().
Referenced by extract().
Return the address based on a given index.
Definition at line 171 of file DWARFDebugAddr.cpp.
References llvm::createStringError(), and llvm::invalid_argument.
Return the parsed addresses of this table.
Definition at line 91 of file DWARFDebugAddr.h.
|
inline |
Return the address size of this table.
Definition at line 85 of file DWARFDebugAddr.h.
|
inline |
Return the DWARF format of this table.
Definition at line 76 of file DWARFDebugAddr.h.
std::optional< uint64_t > DWARFDebugAddrTable::getFullLength | ( | ) | const |
Return the full length of this table, including the length field.
Return std::nullopt if the length cannot be identified reliably.
Definition at line 180 of file DWARFDebugAddr.cpp.
References llvm::dwarf::getUnitLengthFieldByteSize().
Referenced by dumpAddrSection().
|
inline |
Return the length of this table.
Definition at line 79 of file DWARFDebugAddr.h.
References llvm::Length.
|
inline |
Return the segment selector size of this table.
Definition at line 88 of file DWARFDebugAddr.h.
|
inline |
Return the version of this table.
Definition at line 82 of file DWARFDebugAddr.h.