LLDB  mainline
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
lldb_private::LineTable Class Reference

A line table class. More...

#include "lldb/Symbol/LineTable.h"

Collaboration diagram for lldb_private::LineTable:
Collaboration graph
[legend]

Classes

struct  Entry
 
struct  EntrySearchInfo
 
class  LineSequenceImpl
 

Public Types

typedef lldb_private::RangeArray< lldb::addr_t, lldb::addr_t, 32 > FileAddressRanges
 
typedef RangeDataVector< lldb::addr_t, lldb::addr_t, lldb::addr_tFileRangeMap
 Given a file range link map, relink the current line table and return a fixed up line table. More...
 

Public Member Functions

 LineTable (CompileUnit *comp_unit)
 Construct with compile unit. 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...
 
LineSequenceCreateLineSequenceContainer ()
 
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)
 
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...
 
LineTableLinkLineTable (const FileRangeMap &file_range_map)
 

Protected Types

typedef std::vector< lldb_private::Section * > section_collection
 The collection type for the sections. More...
 
typedef std::vector< Entryentry_collection
 The collection type for the line entries. More...
 

Protected Member Functions

bool ConvertEntryAtIndexToLineEntry (uint32_t idx, LineEntry &line_entry)
 

Protected Attributes

CompileUnitm_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...
 

Detailed Description

A line table class.

Definition at line 37 of file LineTable.h.

Member Typedef Documentation

◆ entry_collection

typedef std::vector<Entry> lldb_private::LineTable::entry_collection
protected

The collection type for the line entries.

Definition at line 318 of file LineTable.h.

◆ FileAddressRanges

Definition at line 180 of file LineTable.h.

◆ FileRangeMap

Given a file range link map, relink the current line table and return a fixed up line table.

Parameters
[out]file_range_mapA collection of file ranges that maps to new file ranges that will be used when linking the line table.
Returns
A new line table if at least one line table entry was able to be mapped.

Definition at line 208 of file LineTable.h.

◆ section_collection

The collection type for the sections.

Definition at line 316 of file LineTable.h.

Constructor & Destructor Documentation

◆ LineTable()

LineTable::LineTable ( CompileUnit comp_unit)

Construct with compile unit.

Parameters
[in]comp_unitThe compile unit to which this line table belongs.

Definition at line 21 of file LineTable.cpp.

Referenced by LinkLineTable().

◆ ~LineTable()

LineTable::~LineTable ( )

Destructor.

Definition at line 25 of file LineTable.cpp.

Member Function Documentation

◆ AppendLineEntryToSequence()

void LineTable::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 
)

◆ ConvertEntryAtIndexToLineEntry()

bool LineTable::ConvertEntryAtIndexToLineEntry ( uint32_t  idx,
LineEntry line_entry 
)
protected

◆ CreateLineSequenceContainer()

LineSequence * LineTable::CreateLineSequenceContainer ( )

Definition at line 55 of file LineTable.cpp.

Referenced by ParseDWARFLineTableCallback().

◆ Dump()

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.

Parameters
[in]sThe stream to which to dump the object description.
[in]styleThe display style for the address.
See also
Address::DumpStyle

Definition at line 391 of file LineTable.cpp.

References ConvertEntryAtIndexToLineEntry(), lldb_private::LineEntry::Dump(), lldb_private::Stream::EOL(), m_entries, and lldb_private::LineEntry::original_file.

◆ FindLineEntryByAddress()

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.

Parameters
[in]so_addrA section offset address object containing the address we are searching for.
[out]line_entryA copy of the line entry that was found if true is returned, otherwise entry is left unmodified.
[out]index_ptrA pointer to a 32 bit integer that will get the actual line entry index if it is not nullptr.
Returns
Returns true if so_addr is contained in a line entry in this line table, false otherwise.

Definition at line 170 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 lldb_private::Function::GetEndLineSourceInfo(), SymbolFileDWARF::GetGlobalAranges(), lldb_private::Function::GetPrologueByteSize(), lldb_private::Function::GetStartLineSourceInfo(), lldb_private::breakpad::SymbolFileBreakpad::ParseSupportFiles(), and lldb_private::ThreadPlanStepOverRange::ShouldStop().

◆ FindLineEntryIndexByFileIndex() [1/2]

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.

Parameters
[in]start_idxThe number of entries to skip when starting the search.
[out]file_idxThe 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]lineThe source line to match.
[in]exactIf true, match only if you find a line entry exactly matching line. If false, return the closest line entry greater than line.
[out]line_entryA reference to a line entry object that will get a copy of the line entry if true is returned, otherwise line_entry is left untouched.
Returns
Returns true if a matching line entry is found in this line table, false otherwise.
See also
CompileUnit::GetSupportFiles()
FileSpecList::FindFileIndex (uint32_t, const FileSpec &) const

Definition at line 319 of file LineTable.cpp.

References ConvertEntryAtIndexToLineEntry(), lldb_private::LineTable::Entry::is_terminal_entry, m_entries, and UINT32_MAX.

Referenced by lldb_private::CompileUnit::FindLineEntry(), SymbolFileDWARF::GetGlobalAranges(), and lldb_private::CompileUnit::ResolveSymbolContext().

◆ FindLineEntryIndexByFileIndex() [2/2]

uint32_t LineTable::FindLineEntryIndexByFileIndex ( uint32_t  start_idx,
const std::vector< uint32_t > &  file_indexes,
uint32_t  line,
bool  exact,
LineEntry line_entry_ptr 
)

◆ FineLineEntriesForFileIndex()

size_t LineTable::FineLineEntriesForFileIndex ( uint32_t  file_idx,
bool  append,
SymbolContextList sc_list 
)

◆ GetContiguousFileAddressRanges()

size_t LineTable::GetContiguousFileAddressRanges ( FileAddressRanges file_ranges,
bool  append 
)

Gets all contiguous file address ranges for the entire line table.

Parameters
[out]file_rangesA collection of file address ranges that will be filled in by this function.
[out]appendIf true, then append to file_ranges, otherwise clear file_ranges prior to adding any ranges.
Returns
The number of address ranges added to file_ranges

Definition at line 416 of file LineTable.cpp.

References lldb_private::RangeArray< B, S, N >::Append(), lldb_private::Range< B, S >::Clear(), lldb_private::RangeArray< B, S, N >::Clear(), lldb_private::LineTable::Entry::file_addr, lldb_private::Range< B, S >::GetRangeBase(), lldb_private::RangeArray< 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().

Referenced by DWARFUnit::BuildAddressRangeTable().

◆ GetDescription()

void LineTable::GetDescription ( Stream s,
Target target,
lldb::DescriptionLevel  level 
)

◆ GetLineEntryAtIndex()

bool LineTable::GetLineEntryAtIndex ( uint32_t  idx,
LineEntry line_entry 
)

Get the line entry from the line table at index idx.

Parameters
[in]idxAn index into the line table entry collection.
Returns
A valid line entry if idx is a valid index, or an invalid line entry if idx is not valid.
See also
LineTable::GetSize()
LineEntry::IsValid() const

Definition at line 161 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().

◆ GetSize()

uint32_t LineTable::GetSize ( ) const

Gets the size of the line table in number of line table entries.

Returns
The number of line table entries in this line table.

Definition at line 159 of file LineTable.cpp.

References m_entries.

Referenced by lldb::SBCompileUnit::GetNumLineEntries().

◆ InsertLineEntry()

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.

Parameters
[in]line_entryA const reference to a new line_entry to add to this line table.
See also
Address::DumpStyle

Definition at line 27 of file LineTable.cpp.

References m_entries.

◆ InsertSequence()

void LineTable::InsertSequence ( LineSequence sequence)

◆ LinkLineTable()

LineTable * LineTable::LinkLineTable ( const FileRangeMap file_range_map)

Member Data Documentation

◆ m_comp_unit

CompileUnit* lldb_private::LineTable::m_comp_unit
protected

The compile unit that this line table belongs to.

Definition at line 321 of file LineTable.h.

Referenced by ConvertEntryAtIndexToLineEntry(), FindLineEntryByAddress(), FineLineEntriesForFileIndex(), GetDescription(), and LinkLineTable().

◆ m_entries

entry_collection lldb_private::LineTable::m_entries
protected

The documentation for this class was generated from the following files: