9#ifndef LLDB_SYMBOL_LINETABLE_H
10#define LLDB_SYMBOL_LINETABLE_H
57 uint16_t file_idx,
bool is_start_of_statement,
58 bool is_start_of_basic_block,
bool is_prologue_end,
59 bool is_epilogue_begin,
bool is_terminal_entry);
65 uint32_t line, uint16_t column, uint16_t file_idx,
66 bool is_start_of_statement,
67 bool is_start_of_basic_block,
bool is_prologue_end,
68 bool is_epilogue_begin,
bool is_terminal_entry);
98 std::pair<uint32_t, uint32_t>
119 uint32_t *index_ptr =
nullptr);
157 uint32_t start_idx,
const std::vector<uint32_t> &file_idx,
212 uint16_t _file_idx,
bool _is_start_of_statement,
213 bool _is_start_of_basic_block,
bool _is_prologue_end,
214 bool _is_epilogue_begin,
bool _is_terminal_entry)
239#define SCALAR_COMPARE(a, b) \
298 m_entries = std::exchange(rhs.m_entries, {});
327 typedef std::vector<lldb_private::Section *>
329 typedef std::vector<Entry>
343 template <
typename T>
345 uint32_t start_idx, T file_idx,
347 std::function<
bool(T, uint16_t)> file_idx_matcher) {
354 const uint32_t line = src_location_spec.
GetLine().value_or(0);
355 const uint16_t column =
359 for (
size_t idx = start_idx; idx < count; ++idx) {
365 if (!file_idx_matcher(file_idx,
m_entries[idx].file_idx))
376 }
else if (
m_entries[idx].line == line) {
379 }
else if (!exact_match) {
387 }
else if (
m_entries[idx].line == line &&
391 }
else if (!exact_match) {
#define SCALAR_COMPARE(a, b)
A section + offset based address range class.
A section + offset based address class.
DumpStyle
Dump styles allow the Address::Dump(Stream *,DumpStyle) const function to display Address contents in...
A class that describes a compilation unit.
LessThanBinaryPredicate(LineTable *line_table)
bool operator()(const LineTable::Entry &, const LineTable::Entry &) const
std::vector< Entry > m_entries
Sequence(const Sequence &)=delete
Sequence & operator=(const Sequence &)=delete
Sequence & operator=(Sequence &&rhs)
CompileUnit * m_comp_unit
The compile unit that this line table belongs to.
std::pair< uint32_t, uint32_t > GetLineEntryIndexRange(const AddressRange &range) const
Returns the (half-open) range of line entry indexes which overlap the given address range.
void Dump(Stream *s, Target *target, Address::DumpStyle style, Address::DumpStyle fallback_style, bool show_line_ranges)
Dump all line entries in this line table to the stream s.
size_t FindLineEntriesForFileIndex(uint32_t file_idx, bool append, SymbolContextList &sc_list)
static void AppendLineEntryToSequence(Sequence &sequence, lldb::addr_t file_addr, uint32_t line, uint16_t column, uint16_t file_idx, bool is_start_of_statement, bool is_start_of_basic_block, bool is_prologue_end, bool is_epilogue_begin, bool is_terminal_entry)
void InsertLineEntry(lldb::addr_t file_addr, uint32_t line, uint16_t column, uint16_t file_idx, bool is_start_of_statement, bool is_start_of_basic_block, bool is_prologue_end, bool is_epilogue_begin, bool is_terminal_entry)
Adds a new line entry to this line table.
LineTable(const LineTable &)=delete
bool FindLineEntryByAddress(const Address &so_addr, LineEntry &line_entry, uint32_t *index_ptr=nullptr)
Find a line entry that contains the section offset address so_addr.
std::vector< Entry > entry_collection
The collection type for the line entries.
uint32_t FindLineEntryIndexByFileIndexImpl(uint32_t start_idx, T file_idx, const SourceLocationSpec &src_location_spec, LineEntry *line_entry_ptr, std::function< bool(T, uint16_t)> file_idx_matcher)
uint32_t FindLineEntryIndexByFileIndex(uint32_t start_idx, uint32_t file_idx, const SourceLocationSpec &src_location_spec, LineEntry *line_entry_ptr)
Find a line entry index that has a matching file index and source line number.
uint32_t lower_bound(const Address &so_addr) const
Returns the index of the first line entry which ends after the given address (i.e....
LineTable(CompileUnit *comp_unit)
Construct with compile unit.
std::vector< lldb_private::Section * > section_collection
The collection type for the sections.
bool ConvertEntryAtIndexToLineEntry(uint32_t idx, LineEntry &line_entry)
RangeDataVector< lldb::addr_t, lldb::addr_t, lldb::addr_t > FileRangeMap
LineTable * LinkLineTable(const FileRangeMap &file_range_map)
void InsertSequence(Sequence sequence)
lldb_private::RangeVector< lldb::addr_t, lldb::addr_t, 32 > FileAddressRanges
entry_collection m_entries
The collection of line entries in this line table.
void GetDescription(Stream *s, Target *target, lldb::DescriptionLevel level)
size_t GetContiguousFileAddressRanges(FileAddressRanges &file_ranges, bool append)
Gets all contiguous file address ranges for the entire line table.
const LineTable & operator=(const LineTable &)=delete
bool GetLineEntryAtIndex(uint32_t idx, LineEntry &line_entry)
Get the line entry from the line table at index idx.
uint32_t GetSize() const
Gets the size of the line table in number of line table entries.
"lldb/Core/SourceLocationSpec.h" A source location specifier class.
std::optional< uint32_t > GetLine() const
std::optional< uint16_t > GetColumn() const
bool GetExactMatch() const
A stream class that can stream formatted output to a file.
Defines a list of symbol context objects.
#define LLDB_INVALID_COLUMN_NUMBER
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
A line table entry class.
lldb_private::Section * a_section
int bsearch_compare(const void *key, const void *arrmem)
uint32_t is_start_of_statement
Indicates this entry is the beginning of a statement.
uint32_t is_epilogue_begin
Indicates this entry is one (of possibly many) where execution should be suspended for an exit breakp...
static bool EntryAddressLessThan(const Entry &lhs, const Entry &rhs)
uint32_t is_terminal_entry
Indicates this entry is that of the first byte after the end of a sequence of target machine instruct...
uint32_t is_prologue_end
Indicates this entry is one (of possibly many) where execution should be suspended for an entry break...
uint16_t file_idx
The file index into CompileUnit's file table, or zero if there is no file information.
Entry(lldb::addr_t _file_addr, uint32_t _line, uint16_t _column, uint16_t _file_idx, bool _is_start_of_statement, bool _is_start_of_basic_block, bool _is_prologue_end, bool _is_epilogue_begin, bool _is_terminal_entry)
lldb::addr_t file_addr
The file address for this line entry.
static int Compare(const Entry &lhs, const Entry &rhs)
uint32_t is_start_of_basic_block
Indicates this entry is the beginning of a basic block.
uint32_t line
The source line number, or zero if there is no line number information.
uint16_t column
The column number of the source line, or zero if there is no column information.