LLVM 20.0.0git
|
#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_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. | |
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 |
Definition at line 229 of file DWARFDebugLine.h.
using llvm::DWARFDebugLine::LineTable::RowIter = RowVector::const_iterator |
Definition at line 290 of file DWARFDebugLine.h.
using llvm::DWARFDebugLine::LineTable::RowVector = std::vector<Row> |
Definition at line 289 of file DWARFDebugLine.h.
using llvm::DWARFDebugLine::LineTable::SequenceIter = SequenceVector::const_iterator |
Definition at line 292 of file DWARFDebugLine.h.
using llvm::DWARFDebugLine::LineTable::SequenceVector = std::vector<Sequence> |
Definition at line 291 of file DWARFDebugLine.h.
DWARFDebugLine::LineTable::LineTable | ( | ) |
Definition at line 536 of file DWARFDebugLine.cpp.
References clear().
|
inline |
Definition at line 235 of file DWARFDebugLine.h.
References Rows.
|
inline |
Definition at line 237 of file DWARFDebugLine.h.
References Sequences.
void DWARFDebugLine::LineTable::clear | ( | ) |
Definition at line 555 of file DWARFDebugLine.cpp.
References llvm::DWARFDebugLine::Prologue::clear().
void DWARFDebugLine::LineTable::dump | ( | raw_ostream & | OS, |
DIDumpOptions | DumpOptions | ||
) | const |
Definition at line 538 of file DWARFDebugLine.cpp.
References llvm::DWARFDebugLine::Prologue::dump(), llvm::DWARFDebugLine::Row::dumpTableHeader(), and OS.
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().
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().
|
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().
|
inline |
Definition at line 253 of file DWARFDebugLine.h.
References llvm::DWARFDebugLine::Prologue::getLastValidFileIndex().
Definition at line 249 of file DWARFDebugLine.h.
References llvm::DWARFDebugLine::Prologue::hasFileAtIndex().
Referenced by llvm::dwarf_linker::parallel::CompileUnit::getFileName().
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.
bool DWARFDebugLine::LineTable::lookupAddressRange | ( | object::SectionedAddress | Address, |
uint64_t | Size, | ||
std::vector< uint32_t > & | Result | ||
) | const |
Definition at line 1365 of file DWARFDebugLine.cpp.
References llvm::Address, Size, and llvm::object::SectionedAddress::UndefSection.
Referenced by convertFunctionLineTable(), and llvm::DWARFContext::getLineInfoForAddressRange().
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.
struct Prologue llvm::DWARFDebugLine::LineTable::Prologue |
Definition at line 294 of file DWARFDebugLine.h.
Referenced by llvm::dwarf_linker::parallel::CompileUnit::cloneAndEmitLineTable(), llvm::dwarf_linker::parallel::TypeUnit::createDIETree(), llvm::dwarf_linker::parallel::DebugLineSectionEmitter::emit(), llvm::dwarf_linker::classic::DwarfStreamer::emitLineTableForUnit(), llvm::dwarf_linker::parallel::TypeUnit::finishCloningAndEmit(), and llvm::dwarf_linker::parallel::TypeUnit::TypeUnit().
RowVector llvm::DWARFDebugLine::LineTable::Rows |
Definition at line 295 of file DWARFDebugLine.h.
Referenced by appendRow(), llvm::dwarf_linker::parallel::CompileUnit::cloneAndEmitLineTable(), convertFunctionLineTable(), and llvm::DWARFContext::getLineInfoForAddressRange().
SequenceVector llvm::DWARFDebugLine::LineTable::Sequences |
Definition at line 296 of file DWARFDebugLine.h.
Referenced by appendSequence(), and llvm::dwarf_linker::parallel::CompileUnit::cloneAndEmitLineTable().
Represents an invalid row.
Definition at line 233 of file DWARFDebugLine.h.