LLDB  mainline
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
lldb_private::LineEntry Class Reference

A line table entry class. More...

#include "lldb/Symbol/LineEntry.h"

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

Public Member Functions

 LineEntry ()
 Default constructor. More...
 
 LineEntry (const lldb::SectionSP &section_sp, lldb::addr_t section_offset, lldb::addr_t byte_size, const FileSpec &file, uint32_t _line, uint16_t _column, bool _is_start_of_statement, bool _is_start_of_basic_block, bool _is_prologue_end, bool _is_epilogue_begin, bool _is_terminal_entry)
 
void Clear ()
 Clear the object's state. More...
 
bool Dump (Stream *s, Target *target, bool show_file, Address::DumpStyle style, Address::DumpStyle fallback_style, bool show_range) const
 Dump a description of this object to a Stream. More...
 
bool GetDescription (Stream *s, lldb::DescriptionLevel level, CompileUnit *cu, Target *target, bool show_address_only) const
 
bool DumpStopContext (Stream *s, bool show_fullpaths) const
 Dumps information specific to a process that stops at this line entry to the supplied stream s. More...
 
bool IsValid () const
 Check if a line entry object is valid. More...
 
AddressRange GetSameLineContiguousAddressRange (bool include_inlined_functions) const
 Give the range for this LineEntry + any additional LineEntries for this same source line that are contiguous. More...
 
void ApplyFileMappings (lldb::TargetSP target_sp)
 Apply file mappings from target.source-map to the LineEntry's file. More...
 

Static Public Member Functions

static int Compare (const LineEntry &lhs, const LineEntry &rhs)
 Compare two LineEntry objects. More...
 

Public Attributes

AddressRange range
 The section offset address range for this line entry. More...
 
FileSpec file
 The source file, possibly mapped by the target.source-map setting. More...
 
FileSpec original_file
 The original source file, from debug info. More...
 
uint32_t line
 The source line number, or zero if there is no line number information. More...
 
uint16_t column
 The column number of the source line, or zero if there is no column information. More...
 
uint16_t is_start_of_statement: 1
 Indicates this entry is the beginning of a statement. More...
 
uint16_t is_start_of_basic_block: 1
 Indicates this entry is the beginning of a basic block. More...
 
uint16_t is_prologue_end: 1
 Indicates this entry is one (of possibly many) where execution should be suspended for an entry breakpoint of a function. More...
 
uint16_t is_epilogue_begin: 1
 Indicates this entry is one (of possibly many) where execution should be suspended for an exit breakpoint of a function. More...
 
uint16_t is_terminal_entry: 1
 Indicates this entry is that of the first byte after the end of a sequence of target machine instructions. More...
 

Detailed Description

A line table entry class.

Definition at line 20 of file LineEntry.h.

Constructor & Destructor Documentation

◆ LineEntry() [1/2]

LineEntry::LineEntry ( )

Default constructor.

Initialize all member variables to invalid values.

Definition at line 16 of file LineEntry.cpp.

◆ LineEntry() [2/2]

LineEntry::LineEntry ( const lldb::SectionSP &  section_sp,
lldb::addr_t  section_offset,
lldb::addr_t  byte_size,
const FileSpec file,
uint32_t  _line,
uint16_t  _column,
bool  _is_start_of_statement,
bool  _is_start_of_basic_block,
bool  _is_prologue_end,
bool  _is_epilogue_begin,
bool  _is_terminal_entry 
)

Definition at line 21 of file LineEntry.cpp.

Member Function Documentation

◆ ApplyFileMappings()

void LineEntry::ApplyFileMappings ( lldb::TargetSP  target_sp)

Apply file mappings from target.source-map to the LineEntry's file.

Parameters
[in]target_spShared pointer to the target this LineEntry belongs to.

Definition at line 254 of file LineEntry.cpp.

References file, and original_file.

Referenced by lldb_private::StackFrameList::GetFramesUpTo(), and lldb_private::StackFrame::GetSymbolContext().

◆ Clear()

void LineEntry::Clear ( )

◆ Compare()

int LineEntry::Compare ( const LineEntry lhs,
const LineEntry rhs 
)
static

Compare two LineEntry objects.

Parameters
[in]lhsThe Left Hand Side const LineEntry object reference.
[in]rhsThe Right Hand Side const LineEntry object reference.
Returns
  • -1 if lhs < rhs
  • 0 if lhs == rhs
  • 1 if lhs > rhs

Definition at line 158 of file LineEntry.cpp.

References column, lldb_private::FileSpec::Compare(), lldb_private::Address::CompareFileAddress(), file, lldb_private::AddressRange::GetBaseAddress(), lldb_private::AddressRange::GetByteSize(), is_terminal_entry, line, and range.

Referenced by lldb_private::SymbolContext::GetAddressRangeFromHereToEndLine(), lldb::SBLineEntry::operator!=(), lldb_private::operator<(), lldb::SBLineEntry::operator==(), and lldb_private::operator==().

◆ Dump()

bool LineEntry::Dump ( Stream s,
Target target,
bool  show_file,
Address::DumpStyle  style,
Address::DumpStyle  fallback_style,
bool  show_range 
) const

Dump a description of this object to a Stream.

Dump a description of the contents of this object to the supplied stream s.

Parameters
[in]sThe stream to which to dump the object description.
[in]comp_unitThe compile unit object that contains the support file list so the line entry can dump the file name (since this object contains a file index into the support file list).
[in]show_fileIf true, display the filename with the line entry which requires that the compile unit object comp_unit be a valid pointer.
[in]styleThe display style for the section offset address.
Returns
Returns true if the address was able to be displayed using style. File and load addresses may be unresolved and it may not be possible to display a valid address value. Returns false if the address was not able to be properly dumped.
See also
Address::DumpStyle

Definition at line 71 of file LineEntry.cpp.

References column, lldb_private::AddressRange::Dump(), lldb_private::Address::Dump(), file, lldb_private::AddressRange::GetBaseAddress(), is_epilogue_begin, is_prologue_end, is_start_of_basic_block, is_start_of_statement, is_terminal_entry, line, lldb_private::Stream::Printf(), and range.

Referenced by lldb_private::LineTable::Dump(), lldb_private::SymbolContext::Dump(), GetDescription(), and lldb_private::ThreadPlanStepRange::InRange().

◆ DumpStopContext()

bool LineEntry::DumpStopContext ( Stream s,
bool  show_fullpaths 
) const

Dumps information specific to a process that stops at this line entry to the supplied stream s.

Parameters
[in]sThe stream to which to dump the object description.
[in]comp_unitThe compile unit object that contains the support file list so the line entry can dump the file name (since this object contains a file index into the support file list).
Returns
Returns true if the file and line were properly dumped, false otherwise.

Definition at line 51 of file LineEntry.cpp.

References column, lldb_private::FileSpec::Dump(), lldb_private::ConstString::Dump(), file, lldb_private::FileSpec::GetFilename(), line, lldb_private::Stream::Printf(), and lldb_private::Stream::PutChar().

Referenced by lldb_private::SymbolContext::DumpStopContext(), lldb_private::ThreadPlanStepOverRange::GetDescription(), lldb_private::ThreadPlanStepInRange::GetDescription(), and lldb_private::BreakpointLocation::GetDescription().

◆ GetDescription()

bool LineEntry::GetDescription ( Stream s,
lldb::DescriptionLevel  level,
CompileUnit cu,
Target target,
bool  show_address_only 
) const

◆ GetSameLineContiguousAddressRange()

AddressRange LineEntry::GetSameLineContiguousAddressRange ( bool  include_inlined_functions) const

Give the range for this LineEntry + any additional LineEntries for this same source line that are contiguous.

A compiler may emit multiple line entries for a single source line, e.g. to indicate subexpressions at different columns. This method will get the AddressRange for all of the LineEntries for this source line that are contiguous. Line entries with a line number of 0 are treated specially - these are compiler-generated line table entries that the user did not write in their source code, and we want to skip past in the debugger. If this LineEntry is for line 32, and the following LineEntry is for line 0, we will extend the range to include the AddressRange of the line 0 LineEntry (and it will include the range of the following LineEntries that match either 32 or 0.)

When include_inlined_functions is true inlined functions with a call site at this LineEntry will also be included in the complete range.

If the initial LineEntry this method is called on is a line #0, only the range of contiuous LineEntries with line #0 will be included in the complete range.

Parameters
[in]include_inlined_functionsWhether to include inlined functions at the same line or not.
Returns
The contiguous AddressRange for this source line.

Definition at line 193 of file LineEntry.cpp.

References lldb_private::SymbolContext::block, lldb_private::AddressRange::Extend(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::AddressRange::GetByteSize(), lldb_private::Block::GetContainingInlinedBlock(), lldb_private::Block::GetContainingInlinedBlockWithCallSite(), IsValid(), line, lldb_private::SymbolContext::line_entry, original_file, range, and lldb_private::Address::Slide().

Referenced by lldb_private::ThreadPlanStepRange::InRange(), lldb_private::Thread::QueueThreadPlanForStepInRange(), lldb_private::Thread::QueueThreadPlanForStepOverRange(), and lldb_private::ThreadPlanStepOut::ThreadPlanStepOut().

◆ IsValid()

bool LineEntry::IsValid ( ) const

Member Data Documentation

◆ column

uint16_t lldb_private::LineEntry::column

◆ file

FileSpec lldb_private::LineEntry::file

◆ is_epilogue_begin

uint16_t lldb_private::LineEntry::is_epilogue_begin

Indicates this entry is one (of possibly many) where execution should be suspended for an exit breakpoint of a function.

Definition at line 159 of file LineEntry.h.

Referenced by Clear(), lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), Dump(), and GetDescription().

◆ is_prologue_end

uint16_t lldb_private::LineEntry::is_prologue_end

Indicates this entry is one (of possibly many) where execution should be suspended for an entry breakpoint of a function.

Definition at line 159 of file LineEntry.h.

Referenced by Clear(), lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), Dump(), GetDescription(), and lldb_private::Function::GetPrologueByteSize().

◆ is_start_of_basic_block

uint16_t lldb_private::LineEntry::is_start_of_basic_block

Indicates this entry is the beginning of a basic block.

Definition at line 159 of file LineEntry.h.

Referenced by Clear(), lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), Dump(), and GetDescription().

◆ is_start_of_statement

uint16_t lldb_private::LineEntry::is_start_of_statement

Indicates this entry is the beginning of a statement.

Definition at line 159 of file LineEntry.h.

Referenced by Clear(), lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), Dump(), and GetDescription().

◆ is_terminal_entry

uint16_t lldb_private::LineEntry::is_terminal_entry

Indicates this entry is that of the first byte after the end of a sequence of target machine instructions.

Definition at line 159 of file LineEntry.h.

Referenced by Clear(), Compare(), lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), Dump(), and GetDescription().

◆ line

uint32_t lldb_private::LineEntry::line

The source line number, or zero if there is no line number information.

Definition at line 154 of file LineEntry.h.

Referenced by Clear(), Compare(), lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), lldb_private::ThreadPlanShouldStopHere::DefaultShouldStopHereCallback(), lldb_private::ThreadPlanShouldStopHere::DefaultStepFromHereCallback(), CommandObjectSourceList::DisplayFunctionSource(), CommandObjectSourceList::DoExecute(), CommandObjectThreadJump::DoExecute(), Dump(), CommandObjectSourceInfo::DumpFileLinesInCompUnit(), CommandObjectSourceInfo::DumpLinesInSymbolContexts(), DumpStopContext(), lldb_private::Disassembler::ElideMixedSourceAndDisassemblyLine(), lldb_private::FormatEntity::Format(), lldb_private::SymbolContext::GetAddressRangeFromHereToEndLine(), lldb_private::SourceManager::GetDefaultFileAndLine(), GetDescription(), lldb_private::BreakpointLocation::GetDescription(), lldb_private::Function::GetEndLineSourceInfo(), SymbolFileDWARF::GetGlobalAranges(), lldb_private::SymbolContext::GetParentOfInlinedScope(), lldb_private::Symbol::GetPrologueByteSize(), lldb_private::Function::GetPrologueByteSize(), GetSameLineContiguousAddressRange(), lldb_private::Function::GetStartLineSourceInfo(), lldb_private::ClangExpressionSourceCode::GetText(), lldb_private::ThreadPlanStepRange::InRange(), IsValid(), lldb_private::formatters::LibcxxFunctionSummaryProvider(), CommandObjectSourceList::SourceInfo::operator!=(), CommandObjectSourceList::SourceInfo::operator<(), CommandObjectSourceList::SourceInfo::operator==(), lldb_private::Disassembler::PrintInstructions(), lldb_private::BreakpointResolver::ResolveBreakpoint(), lldb_private::CompileUnit::ResolveSymbolContext(), lldb::SBLineEntry::SetColumn(), lldb_private::StackFrameList::SetDefaultFileAndLineToSelectedFrame(), lldb::SBLineEntry::SetLine(), lldb_private::BreakpointResolver::SetSCMatchesByLine(), lldb_private::SymbolContextSpecifier::SymbolContextMatches(), and SourceFileWindowDelegate::WindowDelegateDraw().

◆ original_file

FileSpec lldb_private::LineEntry::original_file

◆ range

AddressRange lldb_private::LineEntry::range

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