LLVM 20.0.0git
Public Member Functions | List of all members
llvm::DWARFDebugAddrTable Class Reference

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_tgetAddrEntry (uint32_t Index) const
 Return the address based on a given index.
 
std::optional< uint64_tgetFullLength () 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_tgetAddressEntries () const
 Return the parsed addresses of this table.
 

Detailed Description

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.

Member Function Documentation

◆ dump()

void DWARFDebugAddrTable::dump ( raw_ostream OS,
DIDumpOptions  DumpOpts = {} 
) const

◆ extract()

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().

◆ extractPreStandard()

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().

◆ extractV5()

Error DWARFDebugAddrTable::extractV5 ( const DWARFDataExtractor Data,
uint64_t OffsetPtr,
uint8_t  CUAddrSize,
std::function< void(Error)>  WarnCallback 
)

◆ getAddrEntry()

Expected< uint64_t > DWARFDebugAddrTable::getAddrEntry ( uint32_t  Index) const

Return the address based on a given index.

Definition at line 171 of file DWARFDebugAddr.cpp.

References llvm::createStringError(), and llvm::invalid_argument.

◆ getAddressEntries()

ArrayRef< uint64_t > llvm::DWARFDebugAddrTable::getAddressEntries ( ) const
inline

Return the parsed addresses of this table.

Definition at line 91 of file DWARFDebugAddr.h.

◆ getAddressSize()

uint8_t llvm::DWARFDebugAddrTable::getAddressSize ( ) const
inline

Return the address size of this table.

Definition at line 85 of file DWARFDebugAddr.h.

◆ getFormat()

dwarf::DwarfFormat llvm::DWARFDebugAddrTable::getFormat ( ) const
inline

Return the DWARF format of this table.

Definition at line 76 of file DWARFDebugAddr.h.

◆ getFullLength()

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().

◆ getLength()

uint64_t llvm::DWARFDebugAddrTable::getLength ( ) const
inline

Return the length of this table.

Definition at line 79 of file DWARFDebugAddr.h.

References llvm::Length.

◆ getSegmentSelectorSize()

uint8_t llvm::DWARFDebugAddrTable::getSegmentSelectorSize ( ) const
inline

Return the segment selector size of this table.

Definition at line 88 of file DWARFDebugAddr.h.

◆ getVersion()

uint16_t llvm::DWARFDebugAddrTable::getVersion ( ) const
inline

Return the version of this table.

Definition at line 82 of file DWARFDebugAddr.h.


The documentation for this class was generated from the following files: