9#ifndef LLDB_SYMBOL_LINETABLE_H
10#define LLDB_SYMBOL_LINETABLE_H
53 std::vector<std::unique_ptr<LineSequence>> &&sequences);
72 uint16_t file_idx,
bool is_start_of_statement,
73 bool is_start_of_basic_block,
bool is_prologue_end,
74 bool is_epilogue_begin,
bool is_terminal_entry);
82 uint32_t line, uint16_t column,
83 uint16_t file_idx,
bool is_start_of_statement,
84 bool is_start_of_basic_block,
85 bool is_prologue_end,
bool is_epilogue_begin,
86 bool is_terminal_entry);
123 uint32_t *index_ptr =
nullptr);
161 uint32_t start_idx,
const std::vector<uint32_t> &file_idx,
216 uint16_t _file_idx,
bool _is_start_of_statement,
217 bool _is_start_of_basic_block,
bool _is_prologue_end,
218 bool _is_epilogue_begin,
bool _is_terminal_entry)
243#define SCALAR_COMPARE(a, b) \
268 const std::unique_ptr<LineSequence> &)
const;
313 typedef std::vector<lldb_private::Section *>
315 typedef std::vector<Entry>
330 void Clear()
override;
342 template <
typename T>
344 uint32_t start_idx, T file_idx,
346 std::function<
bool(T, uint16_t)> file_idx_matcher) {
353 const uint32_t line = src_location_spec.
GetLine().value_or(0);
354 const uint16_t column =
358 for (
size_t idx = start_idx; idx < count; ++idx) {
364 if (!file_idx_matcher(file_idx,
m_entries[idx].file_idx))
375 }
else if (
m_entries[idx].line == line) {
378 }
else if (!exact_match) {
386 }
else if (
m_entries[idx].line == line &&
390 }
else if (!exact_match) {
#define SCALAR_COMPARE(a, b)
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.
An abstract base class used during symbol table creation.
virtual ~LineSequence()=default
LineSequence(const LineSequence &)=delete
const LineSequence & operator=(const LineSequence &)=delete
bool operator()(const LineTable::Entry &, const LineTable::Entry &) const
bool operator()(const std::unique_ptr< LineSequence > &, const std::unique_ptr< LineSequence > &) const
~LineSequenceImpl() override=default
LineSequenceImpl()=default
entry_collection m_entries
The collection of line entries in this sequence.
CompileUnit * m_comp_unit
The compile unit that this line table belongs to.
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 std::unique_ptr< LineSequence > CreateLineSequenceContainer()
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)
static void AppendLineEntryToSequence(LineSequence *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 InsertSequence(LineSequence *sequence)
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.
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)
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.