LLDB
mainline
|
#include "lldb/Symbol/LineTable.h"
Classes | |
struct | Entry |
struct | EntrySearchInfo |
class | LineSequenceImpl |
Public Types | |
typedef lldb_private::RangeVector< lldb::addr_t, lldb::addr_t, 32 > | FileAddressRanges |
typedef RangeDataVector< lldb::addr_t, lldb::addr_t, lldb::addr_t > | FileRangeMap |
Public Member Functions | |
LineTable (CompileUnit *comp_unit) | |
Construct with compile unit. More... | |
LineTable (CompileUnit *comp_unit, std::vector< std::unique_ptr< LineSequence >> &&sequences) | |
Construct with entries found in sequences. More... | |
~LineTable () | |
Destructor. More... | |
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. More... | |
void | InsertSequence (LineSequence *sequence) |
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. More... | |
void | GetDescription (Stream *s, Target *target, lldb::DescriptionLevel level) |
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. More... | |
uint32_t | FindLineEntryIndexByFileIndex (uint32_t start_idx, uint32_t file_idx, uint32_t line, bool exact, LineEntry *line_entry_ptr) |
Find a line entry index that has a matching file index and source line number. More... | |
uint32_t | FindLineEntryIndexByFileIndex (uint32_t start_idx, const std::vector< uint32_t > &file_indexes, uint32_t line, bool exact, LineEntry *line_entry_ptr) |
size_t | FineLineEntriesForFileIndex (uint32_t file_idx, bool append, SymbolContextList &sc_list) |
bool | GetLineEntryAtIndex (uint32_t idx, LineEntry &line_entry) |
Get the line entry from the line table at index idx. More... | |
uint32_t | GetSize () const |
Gets the size of the line table in number of line table entries. More... | |
size_t | GetContiguousFileAddressRanges (FileAddressRanges &file_ranges, bool append) |
Gets all contiguous file address ranges for the entire line table. More... | |
LineTable * | LinkLineTable (const FileRangeMap &file_range_map) |
Static Public Member Functions | |
static std::unique_ptr< LineSequence > | CreateLineSequenceContainer () |
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) |
Protected Types | |
typedef std::vector< lldb_private::Section * > | section_collection |
The collection type for the sections. More... | |
typedef std::vector< Entry > | entry_collection |
The collection type for the line entries. More... | |
Protected Member Functions | |
bool | ConvertEntryAtIndexToLineEntry (uint32_t idx, LineEntry &line_entry) |
Protected Attributes | |
CompileUnit * | m_comp_unit |
The compile unit that this line table belongs to. More... | |
entry_collection | m_entries |
The collection of line entries in this line table. More... | |
Private Member Functions | |
LineTable (const LineTable &)=delete | |
const LineTable & | operator= (const LineTable &)=delete |
A line table class.
Definition at line 39 of file LineTable.h.
|
protected |
The collection type for the line entries.
Definition at line 319 of file LineTable.h.
typedef lldb_private::RangeVector<lldb::addr_t, lldb::addr_t, 32> lldb_private::LineTable::FileAddressRanges |
Definition at line 189 of file LineTable.h.
typedef RangeDataVector<lldb::addr_t, lldb::addr_t, lldb::addr_t> lldb_private::LineTable::FileRangeMap |
Definition at line 207 of file LineTable.h.
|
protected |
The collection type for the sections.
Definition at line 317 of file LineTable.h.
LineTable::LineTable | ( | CompileUnit * | comp_unit | ) |
Construct with compile unit.
[in] | comp_unit | The compile unit to which this line table belongs. |
Definition at line 21 of file LineTable.cpp.
Referenced by LinkLineTable().
LineTable::LineTable | ( | CompileUnit * | comp_unit, |
std::vector< std::unique_ptr< LineSequence >> && | sequences | ||
) |
Construct with entries found in sequences.
[in] | sequences | Unsorted list of line sequences. |
Definition at line 24 of file LineTable.cpp.
References m_entries, and lldb_private::LineTable::LineSequenceImpl::m_entries.
LineTable::~LineTable | ( | ) |
Destructor.
Definition at line 37 of file LineTable.cpp.
|
privatedelete |
|
static |
Definition at line 69 of file LineTable.cpp.
References lldb_private::LineTable::Entry::file_idx, lldb_private::LineTable::Entry::is_prologue_end, and lldb_private::LineTable::LineSequenceImpl::m_entries.
Referenced by AppendLineEntryToSequence(), and TerminateLineSequence().
Definition at line 260 of file LineTable.cpp.
References lldb_private::LineEntry::column, lldb_private::LineTable::Entry::column, lldb_private::LineEntry::file, lldb_private::LineTable::Entry::file_addr, lldb_private::LineTable::Entry::file_idx, lldb_private::AddressRange::GetBaseAddress(), lldb_private::ModuleChild::GetModule(), lldb_private::CompileUnit::GetSupportFiles(), lldb_private::LineEntry::is_epilogue_begin, lldb_private::LineTable::Entry::is_epilogue_begin, lldb_private::LineEntry::is_prologue_end, lldb_private::LineTable::Entry::is_prologue_end, lldb_private::LineEntry::is_start_of_basic_block, lldb_private::LineTable::Entry::is_start_of_basic_block, lldb_private::LineEntry::is_start_of_statement, lldb_private::LineTable::Entry::is_start_of_statement, lldb_private::LineEntry::is_terminal_entry, lldb_private::LineTable::Entry::is_terminal_entry, lldb_private::LineEntry::line, lldb_private::LineTable::Entry::line, m_comp_unit, m_entries, lldb_private::LineEntry::original_file, lldb_private::LineEntry::range, lldb_private::AddressRange::SetByteSize(), and lldb_private::Address::Slide().
Referenced by Dump(), FindLineEntryByAddress(), FindLineEntryIndexByFileIndex(), FineLineEntriesForFileIndex(), GetDescription(), and GetLineEntryAtIndex().
|
static |
Definition at line 65 of file LineTable.cpp.
void LineTable::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.
[in] | s | The stream to which to dump the object description. |
[in] | style | The display style for the address. |
Definition at line 421 of file LineTable.cpp.
References ConvertEntryAtIndexToLineEntry(), lldb_private::LineEntry::Dump(), lldb_private::Stream::EOL(), m_entries, and lldb_private::LineEntry::original_file.
bool LineTable::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.
[in] | so_addr | A section offset address object containing the address we are searching for. |
[out] | line_entry | A copy of the line entry that was found if true is returned, otherwise entry is left unmodified. |
[out] | index_ptr | A pointer to a 32 bit integer that will get the actual line entry index if it is not nullptr. |
Definition at line 188 of file LineTable.cpp.
References ConvertEntryAtIndexToLineEntry(), lldb_private::LineTable::Entry::EntryAddressLessThan(), lldb_private::LineTable::Entry::file_addr, lldb_private::Address::GetFileAddress(), lldb_private::ModuleChild::GetModule(), lldb_private::Address::GetModule(), LLDB_INVALID_ADDRESS, m_comp_unit, m_entries, and UINT32_MAX.
Referenced by CommandObjectThreadUntil::DoExecute(), lldb_private::Function::GetEndLineSourceInfo(), lldb_private::Function::GetPrologueByteSize(), lldb_private::Function::GetStartLineSourceInfo(), and lldb_private::ThreadPlanStepOverRange::ShouldStop().
uint32_t LineTable::FindLineEntryIndexByFileIndex | ( | uint32_t | start_idx, |
const std::vector< uint32_t > & | file_indexes, | ||
uint32_t | line, | ||
bool | exact, | ||
LineEntry * | line_entry_ptr | ||
) |
Definition at line 305 of file LineTable.cpp.
References ConvertEntryAtIndexToLineEntry(), lldb_private::LineTable::Entry::file_idx, lldb_private::LineTable::Entry::is_terminal_entry, lldb_private::LineTable::Entry::line, m_entries, and UINT32_MAX.
uint32_t LineTable::FindLineEntryIndexByFileIndex | ( | uint32_t | start_idx, |
uint32_t | file_idx, | ||
uint32_t | line, | ||
bool | exact, | ||
LineEntry * | line_entry_ptr | ||
) |
Find a line entry index that has a matching file index and source line number.
Finds the next line entry that has a matching file_idx and source line number line starting at the start_idx entries into the line entry collection.
[in] | start_idx | The number of entries to skip when starting the search. |
[out] | file_idx | The file index to search for that should be found prior to calling this function using the following functions: CompileUnit::GetSupportFiles() FileSpecList::FindFileIndex (uint32_t, const FileSpec &) const |
[in] | line | The source line to match. |
[in] | exact | If true, match only if you find a line entry exactly matching line. If false, return the closest line entry greater than line. |
[out] | line_entry_ptr | A pointer to a line entry object that will get a copy of the line entry if true is returned, otherwise line_entry is left untouched. |
Definition at line 349 of file LineTable.cpp.
References ConvertEntryAtIndexToLineEntry(), lldb_private::LineTable::Entry::file_idx, lldb_private::LineTable::Entry::is_terminal_entry, lldb_private::LineTable::Entry::line, m_entries, and UINT32_MAX.
Referenced by lldb_private::CompileUnit::FindLineEntry(), and lldb_private::CompileUnit::ResolveSymbolContext().
size_t LineTable::FineLineEntriesForFileIndex | ( | uint32_t | file_idx, |
bool | append, | ||
SymbolContextList & | sc_list | ||
) |
Definition at line 393 of file LineTable.cpp.
References lldb_private::SymbolContextList::Append(), lldb_private::SymbolContextList::Clear(), ConvertEntryAtIndexToLineEntry(), lldb_private::LineTable::Entry::file_idx, lldb_private::LineTable::Entry::is_terminal_entry, lldb_private::SymbolContext::line_entry, m_comp_unit, and m_entries.
Referenced by lldb_private::FileLineResolver::SearchCallback().
size_t LineTable::GetContiguousFileAddressRanges | ( | FileAddressRanges & | file_ranges, |
bool | append | ||
) |
Gets all contiguous file address ranges for the entire line table.
[out] | file_ranges | A collection of file address ranges that will be filled in by this function. |
[out] | append | If true, then append to file_ranges, otherwise clear file_ranges prior to adding any ranges. |
Definition at line 446 of file LineTable.cpp.
References lldb_private::RangeVector< B, S, N >::Append(), lldb_private::Range< B, S >::Clear(), lldb_private::RangeVector< B, S, N >::Clear(), lldb_private::LineTable::Entry::file_addr, lldb_private::Range< B, S >::GetRangeBase(), lldb_private::RangeVector< B, S, N >::GetSize(), lldb_private::LineTable::Entry::is_terminal_entry, LLDB_INVALID_ADDRESS, m_entries, lldb_private::Range< B, S >::SetRangeBase(), and lldb_private::Range< B, S >::SetRangeEnd().
void LineTable::GetDescription | ( | Stream * | s, |
Target * | target, | ||
lldb::DescriptionLevel | level | ||
) |
Definition at line 435 of file LineTable.cpp.
References ConvertEntryAtIndexToLineEntry(), lldb_private::Stream::EOL(), lldb_private::LineEntry::GetDescription(), m_comp_unit, and m_entries.
Referenced by DumpCompileUnitLineTable().
Get the line entry from the line table at index idx.
[in] | idx | An index into the line table entry collection. |
Definition at line 179 of file LineTable.cpp.
References lldb_private::LineEntry::Clear(), ConvertEntryAtIndexToLineEntry(), and m_entries.
Referenced by lldb::SBCompileUnit::GetLineEntryAtIndex(), lldb_private::Function::GetPrologueByteSize(), and lldb_private::ThreadPlanStepOverRange::ShouldStop().
uint32_t LineTable::GetSize | ( | ) | const |
Gets the size of the line table in number of line table entries.
Definition at line 177 of file LineTable.cpp.
References m_entries.
Referenced by lldb::SBCompileUnit::GetNumLineEntries().
void LineTable::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.
All line entries are maintained in file address order.
[in] | line_entry | A const reference to a new line_entry to add to this line table. |
Definition at line 39 of file LineTable.cpp.
References m_entries.
void LineTable::InsertSequence | ( | LineSequence * | sequence | ) |
Definition at line 105 of file LineTable.cpp.
References lldb_private::LineTable::Entry::EntryAddressLessThan(), m_entries, and lldb_private::LineTable::LineSequenceImpl::m_entries.
Referenced by TerminateLineSequence().
LineTable * LineTable::LinkLineTable | ( | const FileRangeMap & | file_range_map | ) |
Definition at line 471 of file LineTable.cpp.
References lldb_private::LineTable::LineSequenceImpl::Clear(), lldb_private::Range< B, S >::Contains(), lldb_private::RangeData< B, S, T >::data, lldb_private::LineTable::Entry::file_addr, lldb_private::RangeDataVector< B, S, T, N, Compare >::FindEntryThatContains(), lldb_private::Range< B, S >::GetRangeBase(), lldb_private::Range< B, S >::GetRangeEnd(), lldb_private::LineTable::Entry::is_terminal_entry, LineTable(), LLDB_INVALID_ADDRESS, m_comp_unit, m_entries, lldb_private::LineTable::LineSequenceImpl::m_entries, and UNUSED_IF_ASSERT_DISABLED.
Referenced by SymbolFileDWARFDebugMap::LinkOSOLineTable().
|
protected |
The compile unit that this line table belongs to.
Definition at line 322 of file LineTable.h.
Referenced by ConvertEntryAtIndexToLineEntry(), FindLineEntryByAddress(), FineLineEntriesForFileIndex(), GetDescription(), and LinkLineTable().
|
protected |
The collection of line entries in this line table.
Definition at line 324 of file LineTable.h.
Referenced by ConvertEntryAtIndexToLineEntry(), Dump(), FindLineEntryByAddress(), FindLineEntryIndexByFileIndex(), FineLineEntriesForFileIndex(), GetContiguousFileAddressRanges(), GetDescription(), GetLineEntryAtIndex(), GetSize(), InsertLineEntry(), InsertSequence(), LineTable(), and LinkLineTable().