class LineTable
Defined at line 27 of file ../../src/developer/debug/zxdb/symbols/line_table.h
This virtual interface wraps the line information for a single DWARFUnit. This indirection allows
the operations that operate on the line table to be more easily mocked for tests (our
requirements are quite low).
Public Members
vector sequences_
Public Methods
size_t GetNumFileNames ()
Returns the number of file names referenced by this line table. The DWARFDebugLine::Row::File
entries are 1-based (!) indices into a table of this size.
std::optional<std::string> GetFileNameByIndex (uint64_t file_id)
Returns the absolute file name for the given file index. This is the value from
DWARFDebugLine::Row::File (1-based). It will return an empty optional on failure, which
includes lookup errors or if the file is not set for this row (0 index).
void ~LineTable ()
Defined at line 83 of file ../../src/developer/debug/zxdb/symbols/line_table.h
std::optional<std::string> GetFileNameForRow (const Row & row)
Helper wrapper to extract the file from a row.
Defined at line 95 of file ../../src/developer/debug/zxdb/symbols/line_table.h
LazySymbol GetFunctionForRow (const Row & row)
Returns the function associated with the most specific inlined subroutine (or subprogram) for
the given row. This may be invalid if there is no subroutine for this code (could be
compiler-generated).
size_t GetNumSequences ()
Query for sequences. This is used for iterating through the entire line table.
Sequences consist of a contiguous range of addresses and will be in sorted order.
Defined at line 22 of file ../../src/developer/debug/zxdb/symbols/line_table.cc
cpp20::span<const Row> GetSequenceAt (size_t index)
Defined at line 27 of file ../../src/developer/debug/zxdb/symbols/line_table.cc
cpp20::span<const Row> GetRowSequenceForAddress (const SymbolContext & address_context, TargetPointer absolute_address)
Returns the sequence of rows (contiguous addresses ending in an EndSequence tag) containing the
address. The returned array will be empty if the address was not found. See GetRowForAddress().
Watch out: the addresses in the returned rows will all be module-relative.
Defined at line 37 of file ../../src/developer/debug/zxdb/symbols/line_table.cc
FoundRow GetRowForAddress (const SymbolContext & address_context, TargetPointer absolute_address, SkipMode skip_mode)
Finds the row in the line table that covers the given address. If there is no match, the
returned sequence will be empty.
Watch out: the addresses in the returned rows will all be module-relative.
Defined at line 50 of file ../../src/developer/debug/zxdb/symbols/line_table.cc
const Sequence * GetSequenceForRelativeAddress (TargetPointer relative_address)
Will return an null pointer if there isn't one found.
Defined at line 94 of file ../../src/developer/debug/zxdb/symbols/line_table.cc
void EnsureSequences ()
Ensures that the sequences_ vector is populated from the rows.
Defined at line 110 of file ../../src/developer/debug/zxdb/symbols/line_table.cc
Protected Methods
const std::vector<Row> & GetRows ()
Returns the line table row information.
This will not necessarily be sorted by address and may contain stripped regions. Queries should
go through the sequence table.
The implementation should ensure that the returned value never changes. This will be indexed
into sequences and cached.
Enumerations
enum SkipMode
| Name | Value |
|---|---|
| kExactMatch | 0 |
| kSkipCompilerGenerated | 1 |
The line table can contain lines marked with a line number of 0. These entries indicate code
that is compiler-generated and not associated with any source line.
Defined at line 33 of file ../../src/developer/debug/zxdb/symbols/line_table.h