LLDB mainline
|
#include <SourceManager.h>
Classes | |
class | File |
class | SourceFileCache |
The SourceFileCache class separates the source manager from the cache of source files. More... | |
struct | SupportFileAndLine |
Public Types | |
typedef std::shared_ptr< File > | FileSP |
Public Member Functions | |
~SourceManager () | |
FileSP | GetLastFile () |
size_t | DisplaySourceLinesWithLineNumbers (lldb::SupportFileSP support_file_sp, uint32_t line, uint32_t column, uint32_t context_before, uint32_t context_after, const char *current_line_cstr, Stream *s, const SymbolContextList *bp_locs=nullptr) |
size_t | DisplaySourceLinesWithLineNumbersUsingLastFile (uint32_t start_line, uint32_t count, uint32_t curr_line, uint32_t column, const char *current_line_cstr, Stream *s, const SymbolContextList *bp_locs=nullptr) |
size_t | DisplayMoreWithLineNumbers (Stream *s, uint32_t count, bool reverse, const SymbolContextList *bp_locs=nullptr) |
bool | SetDefaultFileAndLine (lldb::SupportFileSP support_file_sp, uint32_t line) |
std::optional< SupportFileAndLine > | GetDefaultFileAndLine () |
bool | DefaultFileAndLineSet () |
void | FindLinesMatchingRegex (lldb::SupportFileSP support_file_sp, RegularExpression ®ex, uint32_t start_line, uint32_t end_line, std::vector< uint32_t > &match_lines) |
FileSP | GetFile (lldb::SupportFileSP support_file_sp) |
SourceManager (const lldb::DebuggerSP &debugger_sp) | |
A source manager can be made with a valid Target, in which case it can use the path remappings to find source files that are not in their build locations. | |
SourceManager (const lldb::TargetSP &target_sp) | |
Protected Attributes | |
lldb::SupportFileSP | m_last_support_file_sp |
uint32_t | m_last_line |
uint32_t | m_last_count |
bool | m_default_set |
lldb::TargetWP | m_target_wp |
lldb::DebuggerWP | m_debugger_wp |
Private Member Functions | |
SourceManager (const SourceManager &)=delete | |
const SourceManager & | operator= (const SourceManager &)=delete |
Definition at line 34 of file SourceManager.h.
typedef std::shared_ptr<File> lldb_private::SourceManager::FileSP |
Definition at line 114 of file SourceManager.h.
SourceManager::SourceManager | ( | const lldb::DebuggerSP & | debugger_sp | ) |
A source manager can be made with a valid Target, in which case it can use the path remappings to find source files that are not in their build locations.
Without a target it won't be able to do this.
Definition at line 76 of file SourceManager.cpp.
SourceManager::SourceManager | ( | const lldb::TargetSP & | target_sp | ) |
Definition at line 71 of file SourceManager.cpp.
|
default |
|
privatedelete |
|
inline |
Definition at line 186 of file SourceManager.h.
References GetFile(), and m_last_support_file_sp.
size_t SourceManager::DisplayMoreWithLineNumbers | ( | Stream * | s, |
uint32_t | count, | ||
bool | reverse, | ||
const SymbolContextList * | bp_locs = nullptr |
||
) |
Definition at line 353 of file SourceManager.cpp.
References DisplaySourceLinesWithLineNumbersUsingLastFile(), GetDefaultFileAndLine(), GetLastFile(), m_default_set, m_last_count, m_last_line, and UINT32_MAX.
Referenced by CommandObjectSourceList::DoExecute().
size_t SourceManager::DisplaySourceLinesWithLineNumbers | ( | lldb::SupportFileSP | support_file_sp, |
uint32_t | line, | ||
uint32_t | column, | ||
uint32_t | context_before, | ||
uint32_t | context_after, | ||
const char * | current_line_cstr, | ||
Stream * | s, | ||
const SymbolContextList * | bp_locs = nullptr |
||
) |
Definition at line 327 of file SourceManager.cpp.
References DisplaySourceLinesWithLineNumbersUsingLastFile(), GetFile(), GetLastFile(), m_last_line, and m_last_support_file_sp.
Referenced by CommandObjectSourceList::DisplayFunctionSource(), CommandObjectSourceList::DoExecute(), lldb_private::StackFrame::GetStatus(), and lldb_private::Disassembler::PrintInstructions().
size_t SourceManager::DisplaySourceLinesWithLineNumbersUsingLastFile | ( | uint32_t | start_line, |
uint32_t | count, | ||
uint32_t | curr_line, | ||
uint32_t | column, | ||
const char * | current_line_cstr, | ||
Stream * | s, | ||
const SymbolContextList * | bp_locs = nullptr |
||
) |
Definition at line 228 of file SourceManager.cpp.
References lldb_private::ansi::FormatAnsiTerminalCodes(), GetDefaultFileAndLine(), GetLastFile(), m_debugger_wp, m_default_set, m_last_count, m_last_line, lldb_private::SymbolContextList::NumLineEntriesWithLine(), lldb_private::Stream::Printf(), lldb_private::Stream::PutChar(), lldb_private::Debugger::ReportWarning(), should_show_stop_column_with_caret(), should_show_stop_line_with_ansi(), lldb_private::toString(), and UINT32_MAX.
Referenced by DisplayMoreWithLineNumbers(), DisplaySourceLinesWithLineNumbers(), and CommandObjectSourceList::DoExecute().
void SourceManager::FindLinesMatchingRegex | ( | lldb::SupportFileSP | support_file_sp, |
RegularExpression & | regex, | ||
uint32_t | start_line, | ||
uint32_t | end_line, | ||
std::vector< uint32_t > & | match_lines | ||
) |
Definition at line 453 of file SourceManager.cpp.
References GetFile().
std::optional< SourceManager::SupportFileAndLine > SourceManager::GetDefaultFileAndLine | ( | ) |
Definition at line 411 of file SourceManager.cpp.
References lldb_private::LineEntry::file_sp, lldb_private::Module::FindFunctions(), GetLastFile(), lldb_private::ModuleFunctionSearchOptions::include_inlines, lldb_private::ModuleFunctionSearchOptions::include_symbols, lldb_private::LineEntry::line, m_default_set, m_last_line, m_last_support_file_sp, m_target_wp, and SetDefaultFileAndLine().
Referenced by DisplayMoreWithLineNumbers(), DisplaySourceLinesWithLineNumbersUsingLastFile(), CommandObjectBreakpointSet::GetDefaultFile(), and lldb_private::REPL::RunLoop().
SourceManager::FileSP SourceManager::GetFile | ( | lldb::SupportFileSP | support_file_sp | ) |
Definition at line 84 of file SourceManager.cpp.
References lldb_private::GetLog(), lldb_private::FileSystem::Instance(), LLDB_LOG, m_debugger_wp, m_target_wp, and lldb_private::Source.
Referenced by DefaultFileAndLineSet(), DisplaySourceLinesWithLineNumbers(), FindLinesMatchingRegex(), GetLastFile(), and SetDefaultFileAndLine().
|
inline |
Definition at line 157 of file SourceManager.h.
References GetFile(), and m_last_support_file_sp.
Referenced by DisplayMoreWithLineNumbers(), DisplaySourceLinesWithLineNumbers(), DisplaySourceLinesWithLineNumbersUsingLastFile(), CommandObjectSourceList::DoExecute(), and GetDefaultFileAndLine().
|
privatedelete |
bool SourceManager::SetDefaultFileAndLine | ( | lldb::SupportFileSP | support_file_sp, |
uint32_t | line | ||
) |
Definition at line 395 of file SourceManager.cpp.
References GetFile(), m_default_set, m_last_line, and m_last_support_file_sp.
Referenced by GetDefaultFileAndLine(), lldb_private::REPL::IOHandlerInputComplete(), and lldb_private::REPL::RunLoop().
|
protected |
Definition at line 203 of file SourceManager.h.
Referenced by lldb_private::SourceManager::File::DisplaySourceLines(), DisplaySourceLinesWithLineNumbersUsingLastFile(), and GetFile().
|
protected |
Definition at line 201 of file SourceManager.h.
Referenced by DisplayMoreWithLineNumbers(), DisplaySourceLinesWithLineNumbersUsingLastFile(), GetDefaultFileAndLine(), and SetDefaultFileAndLine().
|
protected |
Definition at line 200 of file SourceManager.h.
Referenced by DisplayMoreWithLineNumbers(), and DisplaySourceLinesWithLineNumbersUsingLastFile().
|
protected |
Definition at line 199 of file SourceManager.h.
Referenced by DisplayMoreWithLineNumbers(), DisplaySourceLinesWithLineNumbers(), DisplaySourceLinesWithLineNumbersUsingLastFile(), GetDefaultFileAndLine(), and SetDefaultFileAndLine().
|
protected |
Definition at line 198 of file SourceManager.h.
Referenced by DefaultFileAndLineSet(), DisplaySourceLinesWithLineNumbers(), GetDefaultFileAndLine(), GetLastFile(), and SetDefaultFileAndLine().
|
protected |
Definition at line 202 of file SourceManager.h.
Referenced by GetDefaultFileAndLine(), GetFile(), and lldb_private::SourceManager::File::PathRemappingIsStale().