LLVM  14.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. More...
 
Error extractV5 (const DWARFDataExtractor &Data, uint64_t *OffsetPtr, uint8_t CUAddrSize, std::function< void(Error)> WarnCallback)
 Extract a DWARFv5 address table. More...
 
Error extractPreStandard (const DWARFDataExtractor &Data, uint64_t *OffsetPtr, uint16_t CUVersion, uint8_t CUAddrSize)
 Extract a pre-DWARFv5 address table. More...
 
void dump (raw_ostream &OS, DIDumpOptions DumpOpts={}) const
 
Expected< uint64_tgetAddrEntry (uint32_t Index) const
 Return the address based on a given index. More...
 
Optional< uint64_tgetFullLength () const
 Return the full length of this table, including the length field. More...
 
dwarf::DwarfFormat getFormat () const
 Return the DWARF format of this table. More...
 
uint64_t getLength () const
 Return the length of this table. More...
 
uint16_t getVersion () const
 Return the version of this table. More...
 
uint8_t getAddressSize () const
 Return the address size of this table. More...
 
uint8_t getSegmentSelectorSize () const
 Return the segment selector size of this table. More...
 
ArrayRef< uint64_tgetAddressEntries () const
 Return the parsed addresses of this table. More...
 

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 29 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 121 of file DWARFDebugAddr.cpp.

References llvm::createStringError(), llvm::Data, extractPreStandard(), extractV5(), and llvm::invalid_argument.

◆ 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 106 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 
)

Extract a DWARFv5 address table.

Definition at line 41 of file DWARFDebugAddr.cpp.

Referenced by extract().

◆ getAddrEntry()

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

Return the address based on a given index.

Definition at line 170 of file DWARFDebugAddr.cpp.

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

◆ getAddressEntries()

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

Return the parsed addresses of this table.

Definition at line 94 of file DWARFDebugAddr.h.

◆ getAddressSize()

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

Return the address size of this table.

Definition at line 88 of file DWARFDebugAddr.h.

◆ getFormat()

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

Return the DWARF format of this table.

Definition at line 79 of file DWARFDebugAddr.h.

◆ getFullLength()

Optional< uint64_t > DWARFDebugAddrTable::getFullLength ( ) const

Return the full length of this table, including the length field.

Return None if the length cannot be identified reliably.

Definition at line 179 of file DWARFDebugAddr.cpp.

References llvm::dwarf::getUnitLengthFieldByteSize(), and llvm::None.

◆ getLength()

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

Return the length of this table.

Definition at line 82 of file DWARFDebugAddr.h.

◆ getSegmentSelectorSize()

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

Return the segment selector size of this table.

Definition at line 91 of file DWARFDebugAddr.h.

◆ getVersion()

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

Return the version of this table.

Definition at line 85 of file DWARFDebugAddr.h.


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