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

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

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, bool *IsApproximateLine=nullptr) const
 Returns the index of the row with file/line info for a given address, or UnknownRowIndex if there is no such row.
 
bool lookupAddressRange (object::SectionedAddress Address, uint64_t Size, std::vector< uint32_t > &Result) const
 
bool hasFileAtIndex (uint64_t FileIndex) const
 
std::optional< uint64_tgetLastValidFileIndex () 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.
 
bool getFileLineInfoForAddress (object::SectionedAddress Address, bool Approximate, const char *CompDir, DILineInfoSpecifier::FileLineInfoKind Kind, DILineInfo &Result) const
 Fills the Result argument with the file and line information corresponding to Address.
 
bool getDirectoryForEntry (const FileNameEntry &Entry, std::string &Directory) const
 Extracts directory name by its Entry in include directories table in prologue.
 
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.
 

Public Attributes

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

Detailed Description

Definition at line 229 of file DWARFDebugLine.h.

Member Typedef Documentation

◆ RowIter

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

Definition at line 290 of file DWARFDebugLine.h.

◆ RowVector

Definition at line 289 of file DWARFDebugLine.h.

◆ SequenceIter

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

Definition at line 292 of file DWARFDebugLine.h.

◆ SequenceVector

Definition at line 291 of file DWARFDebugLine.h.

Constructor & Destructor Documentation

◆ LineTable()

DWARFDebugLine::LineTable::LineTable ( )

Definition at line 536 of file DWARFDebugLine.cpp.

References clear().

Member Function Documentation

◆ appendRow()

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

Definition at line 235 of file DWARFDebugLine.h.

References Rows.

◆ appendSequence()

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

Definition at line 237 of file DWARFDebugLine.h.

References Sequences.

◆ clear()

void DWARFDebugLine::LineTable::clear ( )

Definition at line 555 of file DWARFDebugLine.cpp.

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

◆ dump()

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

◆ getDirectoryForEntry()

bool DWARFDebugLine::LineTable::getDirectoryForEntry ( const FileNameEntry Entry,
std::string &  Directory 
) const

Extracts directory name by its Entry in include directories table in prologue.

Returns true on success.

Definition at line 1520 of file DWARFDebugLine.cpp.

References llvm::DWARFDebugLine::Prologue::getVersion(), llvm::DWARFDebugLine::Prologue::IncludeDirectories, and llvm::dwarf::toString().

◆ getFileLineInfoForAddress()

bool DWARFDebugLine::LineTable::getFileLineInfoForAddress ( object::SectionedAddress  Address,
bool  Approximate,
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 1501 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 262 of file DWARFDebugLine.h.

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

Referenced by llvm::dwarf_linker::parallel::CompileUnit::getFileName(), llvm::DWARFContext::getInliningInfoForAddress(), and llvm::DWARFContext::getLineInfoForAddressRange().

◆ getLastValidFileIndex()

std::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,
bool IsApproximateLine = nullptr 
) 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 1316 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 
)

Parse prologue and all rows.

Definition at line 789 of file DWARFDebugLine.cpp.

References llvm::DWARFDebugLine::ParsingState::OpcodeAdvanceResults::AddrDelta, llvm::DWARFDebugLine::ParsingState::SpecialOpcodeDelta::Address, llvm::DWARFDebugLine::ParsingState::AddrOpIndexDelta::AddrOffset, assert(), clear(), llvm::dwarf::computeTombstoneAddress(), llvm::consumeError(), llvm::DWARFFormValue::createFromPValue(), llvm::createStringError(), llvm::DWARFDebugLine::FileNameEntry::DirIdx, llvm::DWARFDebugLine::Prologue::dump(), llvm::DWARFFormValue::dumpAddress(), llvm::DWARFDebugLine::Row::dumpTableHeader(), End, llvm::DWARFDebugLine::Prologue::FileNames, llvm::First, llvm::format(), llvm::DWARFDebugLine::Prologue::getAddressSize(), llvm::DataExtractor::getAddressSize(), llvm::DataExtractor::getCStr(), llvm::DWARFDebugLine::Prologue::getLength(), llvm::DWARFDataExtractor::getRelocatedAddress(), llvm::DWARFDataExtractor::getRelocatedValue(), llvm::DataExtractor::getSLEB128(), llvm::DataExtractor::getU8(), llvm::DataExtractor::getULEB128(), I, llvm::illegal_byte_sequence, llvm::raw_ostream::indent(), llvm::invalid_argument, llvm::DataExtractor::isValidOffsetForDataOfSize(), llvm::DWARFDebugLine::FileNameEntry::Length, llvm::DWARFDebugLine::ParsingState::SpecialOpcodeDelta::Line, llvm::dwarf::LNExtendedString(), llvm::dwarf::LNStandardString(), llvm::DWARFDebugLine::FileNameEntry::ModTime, llvm::DWARFDebugLine::FileNameEntry::Name, Name, llvm::DWARFDebugLine::Prologue::OpcodeBase, Operands, llvm::DWARFDebugLine::ParsingState::SpecialOpcodeDelta::OpIndex, llvm::DWARFDebugLine::ParsingState::AddrOpIndexDelta::OpIndexDelta, llvm::DWARFDebugLine::ParsingState::OpcodeAdvanceResults::OpIndexDelta, llvm::DWARFDebugLine::Sequence::orderByHighPC(), OS, llvm::DWARFDebugLine::Prologue::parse(), llvm::DataExtractor::setAddressSize(), llvm::DataExtractor::size(), llvm::DWARFDebugLine::Prologue::sizeofTotalLength(), llvm::DataExtractor::skip(), llvm::sort(), llvm::DWARFDebugLine::Prologue::StandardOpcodeLengths, llvm::Error::success(), llvm::DataExtractor::Cursor::takeError(), llvm::DataExtractor::Cursor::tell(), llvm::DWARFDebugLine::Prologue::TotalLength, llvm::Verbose, and llvm::DIDumpOptions::Verbose.

Member Data Documentation

◆ Prologue

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

◆ Rows

RowVector llvm::DWARFDebugLine::LineTable::Rows

◆ Sequences

SequenceVector llvm::DWARFDebugLine::LineTable::Sequences

◆ UnknownRowIndex

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

Represents an invalid row.

Definition at line 233 of file DWARFDebugLine.h.


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