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"

Public Member Functions

 LineEntry ()
 Default constructor.
 
void Clear ()
 Clear the object's state.
 
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.
 
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.
 
bool IsValid () const
 Check if a line entry object is valid.
 
AddressRange GetSameLineContiguousAddressRange (bool include_inlined_functions) const
 Give the range for this LineEntry + any additional LineEntries for this same source line that are contiguous.
 
void ApplyFileMappings (lldb::TargetSP target_sp)
 Apply file mappings from target.source-map to the LineEntry's file.
 
const FileSpecGetFile () const
 Helper to access the file.
 

Static Public Member Functions

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

Public Attributes

AddressRange range
 The section offset address range for this line entry.
 
lldb::SupportFileSP file_sp
 The source file, possibly mapped by the target.source-map setting.
 
lldb::SupportFileSP original_file_sp
 The original source file, from debug info.
 
uint32_t line = LLDB_INVALID_LINE_NUMBER
 The source line number, or LLDB_INVALID_LINE_NUMBER if there is no line number information.
 
uint16_t column = 0
 The column number of the source line, or zero if there is no column information.
 
uint16_t is_start_of_statement: 1
 Indicates this entry is the beginning of a statement.
 
uint16_t is_start_of_basic_block: 1
 Indicates this entry is the beginning of a basic block.
 
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.
 
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.
 
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.
 

Detailed Description

A line table entry class.

Definition at line 21 of file LineEntry.h.

Constructor & Destructor Documentation

◆ LineEntry()

LineEntry::LineEntry ( )

Default constructor.

Initialize all member variables to invalid values.

Definition at line 16 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 243 of file LineEntry.cpp.

References file_sp, and original_file_sp.

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 147 of file LineEntry.cpp.

References column, lldb_private::FileSpec::Compare(), lldb_private::Address::CompareFileAddress(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::AddressRange::GetByteSize(), GetFile(), 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]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 60 of file LineEntry.cpp.

References column, lldb_private::Address::Dump(), lldb_private::AddressRange::Dump(), lldb_private::AddressRange::GetBaseAddress(), GetFile(), 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::SymbolContext::Dump(), lldb_private::LineTable::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.
Returns
Returns true if the file and line were properly dumped, false otherwise.

Definition at line 39 of file LineEntry.cpp.

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

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

◆ GetDescription()

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

◆ GetFile()

const FileSpec & lldb_private::LineEntry::GetFile ( ) const
inline

◆ 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 continuous 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 182 of file LineEntry.cpp.

References lldb_private::SymbolContext::block, lldb_private::Address::CalculateSymbolContext(), 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_sp, 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

Check if a line entry object is valid.

Returns
Returns true if the line entry contains a valid section offset address, file index, and line number, false otherwise.

Definition at line 35 of file LineEntry.cpp.

References lldb_private::AddressRange::GetBaseAddress(), lldb_private::Address::IsValid(), line, LLDB_INVALID_LINE_NUMBER, and range.

Referenced by lldb_private::SymbolContextList::AppendIfUnique(), lldb_private::Address::CalculateSymbolContextLineEntry(), lldb_private::SymbolContext::DumpStopContext(), lldb_private::FormatEntity::Format(), lldb_private::SymbolContext::GetAddressRange(), lldb_private::SymbolContext::GetAddressRangeFromHereToEndLine(), lldb_private::CommandObjectDisassemble::GetCurrentLineRanges(), lldb_private::ThreadPlanStepInRange::GetDescription(), lldb_private::ThreadPlanStepOverRange::GetDescription(), lldb_private::SymbolContext::GetDescription(), lldb_private::Disassembler::GetFunctionDeclLineEntry(), lldb_private::SymbolContext::GetResolvedMask(), GetSameLineContiguousAddressRange(), lldb_private::StackFrame::GetStatus(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::ClangExpressionSourceCode::GetText(), lldb_private::StackFrame::HasDebugInformation(), lldb_private::ThreadPlanStepRange::InRange(), IsLineEntryValid(), CommandObjectSourceList::SourceInfo::IsValid(), lldb_private::Disassembler::PrintInstructions(), lldb_private::ThreadPlanStepOverRange::ShouldStop(), lldb::SBThread::StepOverUntil(), and lldb_private::ThreadPlanStepOut::ThreadPlanStepOut().

Member Data Documentation

◆ column

uint16_t lldb_private::LineEntry::column = 0

◆ file_sp

lldb::SupportFileSP lldb_private::LineEntry::file_sp

◆ 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 165 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 161 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 157 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 154 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 169 of file LineEntry.h.

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

◆ line

uint32_t lldb_private::LineEntry::line = LLDB_INVALID_LINE_NUMBER

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

Definition at line 147 of file LineEntry.h.

Referenced by Clear(), Compare(), lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), lldb_private::ThreadPlanShouldStopHere::DefaultShouldStopHereCallback(), lldb_private::ThreadPlanShouldStopHere::DefaultStepFromHereCallback(), CommandObjectSourceList::DisplayFunctionSource(), CommandObjectThreadJump::DoExecute(), CommandObjectThreadUntil::DoExecute(), Dump(), CommandObjectSourceInfo::DumpFileLinesInCompUnit(), CommandObjectSourceInfo::DumpLinesInSymbolContexts(), OutputWriterCLI::DumpSegmentContext(), DumpStopContext(), lldb_private::Disassembler::ElideMixedSourceAndDisassemblyLine(), FileLineAndColumnMatches(), lldb_private::BreakpointResolverFileLine::FilterContexts(), lldb_private::FormatEntity::Format(), lldb_private::SymbolContext::GetAddressRangeFromHereToEndLine(), lldb_private::SourceManager::GetDefaultFileAndLine(), lldb_private::Address::GetDescription(), lldb_private::BreakpointLocation::GetDescription(), GetDescription(), lldb_private::Function::GetEndLineSourceInfo(), lldb_private::SymbolContext::GetParentOfInlinedScope(), lldb_private::Function::GetPrologueByteSize(), lldb_private::Symbol::GetPrologueByteSize(), GetSameLineContiguousAddressRange(), lldb_private::Function::GetStartLineSourceInfo(), lldb_private::StackFrame::GetStatus(), lldb_private::Thread::GetStatus(), lldb_private::ClangExpressionSourceCode::GetText(), lldb_private::ThreadPlanStepRange::InRange(), IsLineEntryValid(), IsValid(), lldb_private::formatters::LibcxxFunctionSummaryProvider(), CommandObjectSourceList::SourceInfo::operator!=(), CommandObjectSourceList::SourceInfo::operator<(), CommandObjectSourceList::SourceInfo::operator==(), lldb_private::Disassembler::PrintInstructions(), lldb_private::CompileUnit::ResolveSymbolContext(), lldb::SBLineEntry::SetColumn(), lldb_private::StackFrameList::SetDefaultFileAndLineToSelectedFrame(), lldb::SBLineEntry::SetLine(), lldb_private::BreakpointResolver::SetSCMatchesByLine(), lldb_private::Thread::SetSelectedFrameByIndexNoisily(), and lldb_private::SymbolContextSpecifier::SymbolContextMatches().

◆ original_file_sp

lldb::SupportFileSP lldb_private::LineEntry::original_file_sp

◆ range

AddressRange lldb_private::LineEntry::range

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