Go to the documentation of this file.
9 #ifndef LLVM_DEBUGINFO_DWARF_DWARFDEBUGLINE_H
10 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGLINE_H
134 explicit Row(
bool DefaultIsStmt =
false);
138 void reset(
bool DefaultIsStmt);
144 return std::tie(
LHS.Address.SectionIndex,
LHS.Address.Address) <
145 std::tie(
RHS.Address.SectionIndex,
RHS.Address.Address);
212 return std::tie(
LHS.SectionIndex,
LHS.HighPC) <
213 std::tie(
RHS.SectionIndex,
RHS.HighPC);
243 std::vector<uint32_t> &Result)
const;
260 std::string &Result)
const {
293 getSourceByIndex(
uint64_t FileIndex,
299 std::vector<uint32_t> &Result)
const;
346 bool done()
const {
return Done; }
364 struct ParsingState {
365 ParsingState(
struct LineTable *
LT,
uint64_t TableOffset,
368 void resetRowAndSequence();
369 void appendRowToMatrix();
403 bool ReportAdvanceAddrProblem =
true;
404 bool ReportBadLineRange =
true;
408 using LineTableMapTy = std::map<uint64_t, LineTable>;
409 using LineTableIter = LineTableMapTy::iterator;
410 using LineTableConstIter = LineTableMapTy::const_iterator;
412 LineTableMapTy LineTableMap;
417 #endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGLINE_H
uint32_t sizeofTotalLength() const
This is an optimization pass for GlobalISel generic memory operations.
uint64_t getOffset() const
Get the offset the parser has reached.
std::vector< Sequence > SequenceVector
Expected< const LineTable * > getOrParseLineTable(DWARFDataExtractor &DebugLineData, uint64_t Offset, const DWARFContext &Ctx, const DWARFUnit *U, function_ref< void(Error)> RecoverableErrorHandler)
uint8_t getAddressSize() const
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
bool done() const
Indicates if the parser has parsed as much as possible.
uint8_t EpilogueBegin
A boolean indicating that the current address is one (of possibly many) where execution should be sus...
ContentTypeTracker ContentTypes
This tracks which optional file format content types are present.
uint8_t IsStmt
A boolean indicating that the current instruction is the beginning of a statement.
void dump(raw_ostream &OS) const
std::vector< DWARFFormValue > IncludeDirectories
static bool orderByAddress(const Row &LHS, const Row &RHS)
void appendSequence(const DWARFDebugLine::Sequence &S)
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
const uint32_t UnknownRowIndex
Represents an invalid row.
Error parse(DWARFDataExtractor Data, uint64_t *OffsetPtr, function_ref< void(Error)> RecoverableErrorHandler, const DWARFContext &Ctx, const DWARFUnit *U=nullptr)
uint64_t TotalLength
The size in bytes of the statement information for this compilation unit (not including the total_len...
bool HasModTime
Whether filename entries provide a modification timestamp.
Tagged union holding either a T or a Error.
RowVector::const_iterator RowIter
bool HasLength
Whether filename entries provide a file size.
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.
uint32_t sizeofPrologueLength() const
const dwarf::FormParams getFormParams() const
uint8_t LineRange
This parameter affects the meaning of the special opcodes. See below.
uint8_t BasicBlock
A boolean indicating that the current instruction is the beginning of a basic block.
const LineTable * getLineTable(uint64_t Offset) const
Row(bool DefaultIsStmt=false)
uint8_t EndSequence
A boolean indicating that the current address is that of the first byte after the end of a sequence o...
uint8_t MinInstLength
The size in bytes of the smallest target machine instruction.
const llvm::DWARFDebugLine::FileNameEntry & getFileNameEntry(uint64_t Index) const
Get DWARF-version aware access to the file name entry at the provided index.
static fatal_error_handler_t ErrorHandler
uint8_t MaxOpsPerInst
The maximum number of individual operations that may be encoded in an instruction.
uint64_t SectionIndex
If relocation information is present then this is the index of the section which contains above addre...
Standard .debug_line state machine structure.
bool hasFileAtIndex(uint64_t FileIndex) const
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.
(vector float) vec_cmpeq(*A, *B) C
Optional< uint64_t > getLastValidFileIndex() const
void appendRow(const DWARFDebugLine::Row &R)
uint8_t Isa
An unsigned integer whose value encodes the applicable instruction set architecture for the current i...
uint8_t OpcodeBase
The number assigned to the first special opcode.
bool getFileNameByIndex(uint64_t FileIndex, StringRef CompDir, DILineInfoSpecifier::FileLineInfoKind Kind, std::string &Result, sys::path::Style Style=sys::path::Style::native) const
dwarf::FormParams FormParams
Version, address size (starting in v5), and DWARF32/64 format; these parameters affect interpretation...
This class implements an extremely fast bulk output stream that can only output to a stream.
LineTable parseNext(function_ref< void(Error)> RecoverableErrorHandler, function_ref< void(Error)> UnrecoverableErrorHandler, raw_ostream *OS=nullptr, bool Verbose=false)
Get the next line table from the section.
bool totalLengthIsValid() const
uint8_t SegSelectorSize
In v5, size in bytes of a segment selector.
uint64_t PrologueLength
The number of bytes following the prologue_length field to the beginning of the first byte of the sta...
bool lookupAddressRange(object::SectionedAddress Address, uint64_t Size, std::vector< uint32_t > &Result) const
An efficient, type-erasing, non-owning reference to a callable.
static bool orderByHighPC(const Sequence &LHS, const Sequence &RHS)
Represents a series of contiguous machine instructions.
bool getFileNameByIndex(uint64_t FileIndex, StringRef CompDir, DILineInfoSpecifier::FileLineInfoKind Kind, std::string &Result) const
Extracts filename by its index in filename table in prologue.
Helper to allow for parsing of an entire .debug_line section in sequence.
ContentTypeTracker()=default
static void dumpTableHeader(raw_ostream &OS, unsigned Indent)
void reset(bool DefaultIsStmt)
A format-neutral container for source line information.
bool HasMD5
For v5, whether filename entries provide an MD5 checksum.
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 ...
void postAppend()
Called after a row is appended to the matrix.
uint32_t Discriminator
An unsigned integer representing the DWARF path discriminator value for this location.
void clearLineTable(uint64_t Offset)
StringRef - Represent a constant reference to a string, i.e.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Tracks which optional content types are present in a DWARF file name entry format.
SequenceVector::const_iterator SequenceIter
bool hasFileAtIndex(uint64_t FileIndex) const
uint64_t getLength() const
Length of the prologue in bytes.
Lightweight error class with error context and mandatory checking.
uint32_t Line
An unsigned integer indicating a source line number.
bool HasSource
For v5, whether filename entries provide source text.
uint8_t DefaultIsStmt
The initial value of theis_stmtregister.
object::SectionedAddress Address
The program-counter value corresponding to a machine instruction generated by the compiler and sectio...
Optional< uint64_t > getLastValidFileIndex() const
bool containsPC(object::SectionedAddress PC) const
int8_t LineBase
This parameter affects the meaning of the special opcodes. See below.
uint16_t Column
An unsigned integer indicating a column number within a source line.
std::vector< FileNameEntry > FileNames
std::vector< Row > RowVector
uint8_t PrologueEnd
A boolean indicating that the current address is one (of possibly many) where execution should be sus...
void skip(function_ref< void(Error)> RecoverableErrorHandler, function_ref< void(Error)> UnrecoverableErrorHandler)
Skip the current line table and go to the following line table (if present) immediately.
std::vector< uint8_t > StandardOpcodeLengths
uint16_t getVersion() const
uint64_t LowPC
Sequence describes instructions at address range [LowPC, HighPC) and is described by line table rows ...
A range adaptor for a pair of iterators.
SectionParser(DWARFDataExtractor &Data, const DWARFContext &C, DWARFUnitVector::iterator_range Units)
uint16_t File
An unsigned integer indicating the identity of the source file corresponding to a machine instruction...
std::map< uint64_t, DWARFUnit * > LineToUnitMap
void dump(raw_ostream &OS, DIDumpOptions DumpOptions) const
void trackContentType(dwarf::LineNumberEntryFormat ContentType)
Update tracked content types with ContentType.
void dump(raw_ostream &OS, DIDumpOptions DumpOptions) const
Container for dump options that control which debug information will be dumped.