LLDB mainline
|
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 FileSpec & | GetFile () 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. | |
A line table entry class.
Definition at line 21 of file LineEntry.h.
LineEntry::LineEntry | ( | ) |
Default constructor.
Initialize all member variables to invalid values.
Definition at line 16 of file LineEntry.cpp.
void LineEntry::ApplyFileMappings | ( | lldb::TargetSP | target_sp | ) |
Apply file mappings from target.source-map to the LineEntry's file.
[in] | target_sp | Shared pointer to the target this LineEntry belongs to. |
Definition at line 244 of file LineEntry.cpp.
References file_sp, and original_file_sp.
Referenced by lldb_private::StackFrameList::FetchFramesUpTo(), lldb_private::StackFrame::GetSymbolContext(), and lldb_private::ThreadPlanStepRange::SetNextBranchBreakpoint().
void LineEntry::Clear | ( | ) |
Clear the object's state.
Clears all member variables to invalid values.
Definition at line 22 of file LineEntry.cpp.
References lldb_private::AddressRange::Clear(), column, file_sp, is_epilogue_begin, is_prologue_end, is_start_of_basic_block, is_start_of_statement, is_terminal_entry, line, LLDB_INVALID_LINE_NUMBER, original_file_sp, and range.
Referenced by lldb_private::Address::CalculateSymbolContextLineEntry(), lldb_private::SymbolContext::Clear(), lldb_private::Variable::DumpDeclaration(), lldb_private::LineTable::GetLineEntryAtIndex(), and lldb::SBSymbolContext::SetLineEntry().
Compare two LineEntry objects.
[in] | lhs | The Left Hand Side const LineEntry object reference. |
[in] | rhs | The Right Hand Side const LineEntry object reference. |
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::BreakpointResolver::AddLocation(), lldb_private::SymbolContext::GetAddressRangeFromHereToEndLine(), lldb_private::BreakpointLocation::GetSuggestedStackFrameIndex(), lldb::SBLineEntry::operator!=(), lldb_private::operator<(), lldb::SBLineEntry::operator==(), and lldb_private::operator==().
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.
[in] | s | The stream to which to dump the object description. |
[in] | show_file | If true, display the filename with the line entry which requires that the compile unit object comp_unit be a valid pointer. |
[in] | style | The display style for the section offset address. |
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().
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.
[in] | s | The stream to which to dump the object description. |
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().
bool LineEntry::GetDescription | ( | Stream * | s, |
lldb::DescriptionLevel | level, | ||
CompileUnit * | cu, | ||
Target * | target, | ||
bool | show_address_only | ||
) | const |
Definition at line 95 of file LineEntry.cpp.
References column, lldb_private::Address::Dump(), lldb_private::AddressRange::Dump(), Dump(), lldb_private::Address::DumpStyleFileAddress, lldb_private::Address::DumpStyleLoadAddress, lldb_private::Address::DumpStyleModuleWithFileAddress, lldb::eDescriptionLevelBrief, lldb::eDescriptionLevelFull, lldb_private::Stream::EOL(), 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 CommandObjectSourceInfo::DumpFileLinesInCompUnit(), CommandObjectSourceInfo::DumpLinesInSymbolContexts(), lldb_private::SymbolContext::GetDescription(), and lldb_private::LineTable::GetDescription().
|
inline |
Helper to access the file.
Definition at line 134 of file LineEntry.h.
References file_sp.
Referenced by Compare(), CommandObjectThreadJump::DoExecute(), Dump(), CommandObjectSourceInfo::DumpFileLinesInCompUnit(), CommandObjectSourceInfo::DumpLinesInSymbolContexts(), lldb_private::Disassembler::ElideMixedSourceAndDisassemblyLine(), FileLineAndColumnMatches(), lldb_private::BreakpointResolverFileLine::FilterContexts(), lldb_private::FormatEntity::Format(), CommandObjectBreakpointSet::GetDefaultFile(), lldb_private::Address::GetDescription(), GetDescription(), lldb_private::Function::GetEndLineSourceInfo(), lldb_private::Thread::GetStatus(), lldb_private::BreakpointLocation::GetSuggestedStackFrameIndex(), lldb_private::ClangExpressionSourceCode::GetText(), lldb_private::formatters::LibcxxFunctionSummaryProvider(), CommandObjectSourceList::SourceInfo::operator<(), lldb_private::Disassembler::PrintInstructions(), lldb_private::CompileUnit::ResolveSymbolContext(), lldb_private::StackFrameList::SetDefaultFileAndLineToSelectedFrame(), lldb_private::ThreadPlanStepRange::SetNextBranchBreakpoint(), lldb_private::Thread::SetSelectedFrameByIndexNoisily(), and lldb::SBThread::StepOverUntil().
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.
[in] | include_inlined_functions | Whether to include inlined functions at the same line or not. |
Definition at line 182 of file LineEntry.cpp.
References lldb_private::SymbolContext::block, lldb_private::Address::CalculateSymbolContext(), lldb_private::SupportFile::eEqualFileSpecAndChecksumIfSet, 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().
bool LineEntry::IsValid | ( | ) | const |
Check if a line entry object is valid.
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::CompileUnit::ResolveSymbolContext(), lldb_private::ThreadPlanStepRange::SetNextBranchBreakpoint(), lldb_private::ThreadPlanStepOverRange::ShouldStop(), lldb::SBThread::StepOverUntil(), and lldb_private::ThreadPlanStepOut::ThreadPlanStepOut().
uint16_t lldb_private::LineEntry::column = 0 |
The column number of the source line, or zero if there is no column information.
Definition at line 151 of file LineEntry.h.
Referenced by Clear(), Compare(), lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), Dump(), OutputWriterCLI::DumpSegmentContext(), DumpStopContext(), lldb_private::Disassembler::ElideMixedSourceAndDisassemblyLine(), FileLineAndColumnMatches(), lldb_private::FormatEntity::Format(), lldb_private::Address::GetDescription(), GetDescription(), lldb_private::SymbolContext::GetParentOfInlinedScope(), lldb_private::StackFrame::GetStatus(), lldb_private::BreakpointLocation::GetSuggestedStackFrameIndex(), lldb_private::Disassembler::PrintInstructions(), lldb_private::CompileUnit::ResolveSymbolContext(), and lldb_private::ThreadPlanStepRange::SetNextBranchBreakpoint().
lldb::SupportFileSP lldb_private::LineEntry::file_sp |
The source file, possibly mapped by the target.source-map setting.
Definition at line 140 of file LineEntry.h.
Referenced by ApplyFileMappings(), Clear(), lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), CommandObjectSourceList::DisplayFunctionSource(), DumpStopContext(), lldb_private::BreakpointResolverFileLine::FilterContexts(), lldb_private::SourceManager::GetDefaultFileAndLine(), GetFile(), lldb_private::Disassembler::GetFunctionDeclLineEntry(), lldb_private::SymbolContext::GetParentOfInlinedScope(), lldb_private::Function::GetStartLineSourceInfo(), lldb_private::StackFrame::GetStatus(), lldb_private::Disassembler::PrintInstructions(), lldb_private::StackFrameList::SetDefaultFileAndLineToSelectedFrame(), lldb::SBLineEntry::SetFileSpec(), and lldb_private::ThreadPlanStepRange::SetNextBranchBreakpoint().
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().
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().
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().
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().
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().
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::BreakpointLocation::GetSuggestedStackFrameIndex(), 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::ThreadPlanStepRange::SetNextBranchBreakpoint(), lldb_private::BreakpointResolver::SetSCMatchesByLine(), lldb_private::Thread::SetSelectedFrameByIndexNoisily(), and lldb_private::SymbolContextSpecifier::SymbolContextMatches().
lldb::SupportFileSP lldb_private::LineEntry::original_file_sp |
The original source file, from debug info.
Definition at line 143 of file LineEntry.h.
Referenced by ApplyFileMappings(), Clear(), lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), lldb_private::LineTable::Dump(), lldb_private::Disassembler::GetFunctionDeclLineEntry(), lldb_private::SymbolContext::GetParentOfInlinedScope(), GetSameLineContiguousAddressRange(), lldb_private::ThreadPlanStepRange::InRange(), CommandObjectSourceList::SourceInfo::operator!=(), CommandObjectSourceList::SourceInfo::operator==(), lldb_private::Disassembler::PrintInstructions(), lldb_private::ThreadPlanStepRange::SetNextBranchBreakpoint(), and lldb_private::ThreadPlanStepOverRange::ShouldStop().
AddressRange lldb_private::LineEntry::range |
The section offset address range for this line entry.
Definition at line 137 of file LineEntry.h.
Referenced by lldb_private::BreakpointResolver::AddLocation(), Clear(), Compare(), lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), lldb_private::ThreadPlanShouldStopHere::DefaultStepFromHereCallback(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectThreadUntil::DoExecute(), Dump(), lldb_private::FormatEntity::Format(), lldb_private::StringSummaryFormat::FormatObject(), lldb_private::SymbolContext::GetAddressRange(), lldb_private::SymbolContext::GetAddressRangeFromHereToEndLine(), lldb_private::CommandObjectDisassemble::GetCurrentLineRanges(), GetDescription(), lldb_private::SymbolContext::GetParentOfInlinedScope(), lldb_private::Function::GetPrologueByteSize(), lldb_private::Symbol::GetPrologueByteSize(), GetSameLineContiguousAddressRange(), lldb_private::ThreadPlanStepRange::InRange(), IsValid(), lldb_private::CompileUnit::ResolveSymbolContext(), lldb_private::ThreadPlanStepRange::SetNextBranchBreakpoint(), lldb_private::BreakpointLocation::SetPreferredLineEntry(), lldb_private::BreakpointResolver::SetSCMatchesByLine(), lldb_private::ThreadPlanStepOverRange::ShouldStop(), and lldb::SBThread::StepInto().