LLVM  14.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
llvm::DWARFDebugLine::LineTable Struct Reference

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

Collaboration diagram for llvm::DWARFDebugLine::LineTable:
Collaboration graph
[legend]

Public Types

using RowVector = std::vector< Row >
 
using RowIter = RowVector::const_iterator
 
using SequenceVector = std::vector< Sequence >
 
using SequenceIter = SequenceVector::const_iterator
 

Public Member Functions

 LineTable ()
 
void appendRow (const DWARFDebugLine::Row &R)
 
void appendSequence (const DWARFDebugLine::Sequence &S)
 
uint32_t lookupAddress (object::SectionedAddress Address) const
 Returns the index of the row with file/line info for a given address, or UnknownRowIndex if there is no such row. More...
 
bool lookupAddressRange (object::SectionedAddress Address, uint64_t Size, std::vector< uint32_t > &Result) const
 
bool hasFileAtIndex (uint64_t FileIndex) const
 
Optional< uint64_t > getLastValidFileIndex () const
 
bool getFileNameByIndex (uint64_t FileIndex, StringRef CompDir, DILineInfoSpecifier::FileLineInfoKind Kind, std::string &Result) const
 Extracts filename by its index in filename table in prologue. More...
 
bool getFileLineInfoForAddress (object::SectionedAddress Address, const char *CompDir, DILineInfoSpecifier::FileLineInfoKind Kind, DILineInfo &Result) const
 Fills the Result argument with the file and line information corresponding to Address. More...
 
void dump (raw_ostream &OS, DIDumpOptions DumpOptions) const
 
void clear ()
 
Error parse (DWARFDataExtractor &DebugLineData, uint64_t *OffsetPtr, const DWARFContext &Ctx, const DWARFUnit *U, function_ref< void(Error)> RecoverableErrorHandler, raw_ostream *OS=nullptr, bool Verbose=false)
 Parse prologue and all rows. More...
 

Public Attributes

const uint32_t UnknownRowIndex = UINT32_MAX
 Represents an invalid row. More...
 
struct Prologue Prologue
 
RowVector Rows
 
SequenceVector Sequences
 

Detailed Description

Definition at line 233 of file DWARFDebugLine.h.

Member Typedef Documentation

◆ RowIter

using llvm::DWARFDebugLine::LineTable::RowIter = RowVector::const_iterator

Definition at line 288 of file DWARFDebugLine.h.

◆ RowVector

Definition at line 287 of file DWARFDebugLine.h.

◆ SequenceIter

using llvm::DWARFDebugLine::LineTable::SequenceIter = SequenceVector::const_iterator

Definition at line 290 of file DWARFDebugLine.h.

◆ SequenceVector

Definition at line 289 of file DWARFDebugLine.h.

Constructor & Destructor Documentation

◆ LineTable()

DWARFDebugLine::LineTable::LineTable ( )

Definition at line 514 of file DWARFDebugLine.cpp.

References clear().

Member Function Documentation

◆ appendRow()

void llvm::DWARFDebugLine::LineTable::appendRow ( const DWARFDebugLine::Row R)
inline

Definition at line 239 of file DWARFDebugLine.h.

References Rows.

◆ appendSequence()

void llvm::DWARFDebugLine::LineTable::appendSequence ( const DWARFDebugLine::Sequence S)
inline

Definition at line 241 of file DWARFDebugLine.h.

References S, and Sequences.

◆ clear()

void DWARFDebugLine::LineTable::clear ( )

Definition at line 533 of file DWARFDebugLine.cpp.

References llvm::DWARFDebugLine::Prologue::clear().

◆ dump()

void DWARFDebugLine::LineTable::dump ( raw_ostream OS,
DIDumpOptions  DumpOptions 
) const

Definition at line 516 of file DWARFDebugLine.cpp.

References llvm::DWARFDebugLine::Prologue::dump().

◆ getFileLineInfoForAddress()

bool DWARFDebugLine::LineTable::getFileLineInfoForAddress ( object::SectionedAddress  Address,
const char *  CompDir,
DILineInfoSpecifier::FileLineInfoKind  Kind,
DILineInfo Result 
) const

Fills the Result argument with the file and line information corresponding to Address.

Returns true on success.

Definition at line 1399 of file DWARFDebugLine.cpp.

References llvm::Address, llvm::DWARFDebugLine::Row::Column, llvm::DWARFDebugLine::Row::Discriminator, llvm::DWARFDebugLine::Row::File, and llvm::DWARFDebugLine::Row::Line.

Referenced by llvm::DWARFContext::getInliningInfoForAddress().

◆ getFileNameByIndex()

bool llvm::DWARFDebugLine::LineTable::getFileNameByIndex ( uint64_t  FileIndex,
StringRef  CompDir,
DILineInfoSpecifier::FileLineInfoKind  Kind,
std::string &  Result 
) const
inline

Extracts filename by its index in filename table in prologue.

In Dwarf 4, the files are 1-indexed and the current compilation file name is not represented in the list. In DWARF v5, the files are 0-indexed and the primary source file has the index 0. Returns true on success.

Definition at line 265 of file DWARFDebugLine.h.

References llvm::DWARFDebugLine::Prologue::getFileNameByIndex().

Referenced by llvm::DWARFContext::getInliningInfoForAddress(), and llvm::DWARFContext::getLineInfoForAddressRange().

◆ getLastValidFileIndex()

Optional<uint64_t> llvm::DWARFDebugLine::LineTable::getLastValidFileIndex ( ) const
inline

◆ hasFileAtIndex()

bool llvm::DWARFDebugLine::LineTable::hasFileAtIndex ( uint64_t  FileIndex) const
inline

◆ lookupAddress()

uint32_t DWARFDebugLine::LineTable::lookupAddress ( object::SectionedAddress  Address) const

Returns the index of the row with file/line info for a given address, or UnknownRowIndex if there is no such row.

Definition at line 1237 of file DWARFDebugLine.cpp.

References llvm::Address, and llvm::object::SectionedAddress::UndefSection.

◆ lookupAddressRange()

bool DWARFDebugLine::LineTable::lookupAddressRange ( object::SectionedAddress  Address,
uint64_t  Size,
std::vector< uint32_t > &  Result 
) const

◆ parse()

Error DWARFDebugLine::LineTable::parse ( DWARFDataExtractor DebugLineData,
uint64_t *  OffsetPtr,
const DWARFContext Ctx,
const DWARFUnit U,
function_ref< void(Error)>  RecoverableErrorHandler,
raw_ostream OS = nullptr,
bool  Verbose = false 
)

Member Data Documentation

◆ Prologue

struct Prologue llvm::DWARFDebugLine::LineTable::Prologue

Definition at line 292 of file DWARFDebugLine.h.

◆ Rows

RowVector llvm::DWARFDebugLine::LineTable::Rows

◆ Sequences

SequenceVector llvm::DWARFDebugLine::LineTable::Sequences

Definition at line 294 of file DWARFDebugLine.h.

Referenced by appendSequence().

◆ UnknownRowIndex

const uint32_t llvm::DWARFDebugLine::LineTable::UnknownRowIndex = UINT32_MAX

Represents an invalid row.

Definition at line 237 of file DWARFDebugLine.h.


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