LLVM 20.0.0git
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::DWARFLocationTable Class Referenceabstract

An abstract base class for various kinds of location tables (.debug_loc, .debug_loclists, and their dwo variants). More...

#include "llvm/DebugInfo/DWARF/DWARFDebugLoc.h"

Inheritance diagram for llvm::DWARFLocationTable:
Inheritance graph
[legend]

Public Member Functions

 DWARFLocationTable (DWARFDataExtractor Data)
 
virtual ~DWARFLocationTable ()=default
 
virtual Error visitLocationList (uint64_t *Offset, function_ref< bool(const DWARFLocationEntry &)> Callback) const =0
 Call the user-provided callback for each entry (including the end-of-list entry) in the location list starting at Offset.
 
bool dumpLocationList (uint64_t *Offset, raw_ostream &OS, std::optional< object::SectionedAddress > BaseAddr, const DWARFObject &Obj, DWARFUnit *U, DIDumpOptions DumpOpts, unsigned Indent) const
 Dump the location list at the given Offset.
 
Error visitAbsoluteLocationList (uint64_t Offset, std::optional< object::SectionedAddress > BaseAddr, std::function< std::optional< object::SectionedAddress >(uint32_t)> LookupAddr, function_ref< bool(Expected< DWARFLocationExpression >)> Callback) const
 
const DWARFDataExtractorgetData ()
 

Protected Member Functions

virtual void dumpRawEntry (const DWARFLocationEntry &Entry, raw_ostream &OS, unsigned Indent, DIDumpOptions DumpOpts, const DWARFObject &Obj) const =0
 

Protected Attributes

DWARFDataExtractor Data
 

Detailed Description

An abstract base class for various kinds of location tables (.debug_loc, .debug_loclists, and their dwo variants).

Definition at line 49 of file DWARFDebugLoc.h.

Constructor & Destructor Documentation

◆ DWARFLocationTable()

llvm::DWARFLocationTable::DWARFLocationTable ( DWARFDataExtractor  Data)
inline

Definition at line 51 of file DWARFDebugLoc.h.

◆ ~DWARFLocationTable()

virtual llvm::DWARFLocationTable::~DWARFLocationTable ( )
virtualdefault

Member Function Documentation

◆ dumpLocationList()

bool DWARFLocationTable::dumpLocationList ( uint64_t Offset,
raw_ostream OS,
std::optional< object::SectionedAddress BaseAddr,
const DWARFObject Obj,
DWARFUnit U,
DIDumpOptions  DumpOpts,
unsigned  Indent 
) const

Dump the location list at the given Offset.

The function returns true iff it has successfully reched the end of the list. This means that one can attempt to parse another list after the current one (Offset will be updated to point past the end of the current list).

Definition at line 122 of file DWARFDebugLoc.cpp.

References llvm::consumeError(), Data, llvm::DIDumpOptions::DisplayRawContents, dumpRawEntry(), llvm::format(), llvm::Expected< T >::get(), llvm::DataExtractor::getAddressSize(), if(), llvm::raw_ostream::indent(), llvm::Offset, OS, llvm::DIDumpOptions::RecoverableErrorHandler, llvm::Expected< T >::takeError(), and visitLocationList().

Referenced by llvm::DWARFDebugLoc::dump(), llvm::DWARFContext::dump(), dumpLoclistsSection(), and llvm::DWARFDebugLoclists::dumpRange().

◆ dumpRawEntry()

virtual void llvm::DWARFLocationTable::dumpRawEntry ( const DWARFLocationEntry Entry,
raw_ostream OS,
unsigned  Indent,
DIDumpOptions  DumpOpts,
const DWARFObject Obj 
) const
protectedpure virtual

◆ getData()

const DWARFDataExtractor & llvm::DWARFLocationTable::getData ( )
inline

Definition at line 78 of file DWARFDebugLoc.h.

References Data.

◆ visitAbsoluteLocationList()

Error DWARFLocationTable::visitAbsoluteLocationList ( uint64_t  Offset,
std::optional< object::SectionedAddress BaseAddr,
std::function< std::optional< object::SectionedAddress >(uint32_t)>  LookupAddr,
function_ref< bool(Expected< DWARFLocationExpression >)>  Callback 
) const

◆ visitLocationList()

virtual Error llvm::DWARFLocationTable::visitLocationList ( uint64_t Offset,
function_ref< bool(const DWARFLocationEntry &)>  Callback 
) const
pure virtual

Call the user-provided callback for each entry (including the end-of-list entry) in the location list starting at Offset.

The callback can return false to terminate the iteration early. Returns an error if it was unable to parse the entire location list correctly. Upon successful termination Offset will be updated point past the end of the list.

Implemented in llvm::DWARFDebugLoc, and llvm::DWARFDebugLoclists.

Referenced by dumpLocationList(), and visitAbsoluteLocationList().

Member Data Documentation

◆ Data

DWARFDataExtractor llvm::DWARFLocationTable::Data
protected

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