LLDB mainline
|
#include <SourceManager.h>
Classes | |
class | File |
class | SourceFileCache |
The SourceFileCache class separates the source manager from the cache of source files. More... | |
Public Types | |
typedef std::shared_ptr< File > | FileSP |
Public Member Functions | |
~SourceManager () | |
FileSP | GetLastFile () |
size_t | DisplaySourceLinesWithLineNumbers (const FileSpec &file, 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 (const FileSpec &file_spec, uint32_t line) |
bool | GetDefaultFileAndLine (FileSpec &file_spec, uint32_t &line) |
bool | DefaultFileAndLineSet () |
void | FindLinesMatchingRegex (FileSpec &file_spec, RegularExpression ®ex, uint32_t start_line, uint32_t end_line, std::vector< uint32_t > &match_lines) |
FileSP | GetFile (const FileSpec &file_spec) |
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 | |
FileSpec | m_last_file_spec |
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 33 of file SourceManager.h.
typedef std::shared_ptr<File> lldb_private::SourceManager::FileSP |
Definition at line 99 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 70 of file SourceManager.cpp.
SourceManager::SourceManager | ( | const lldb::TargetSP & | target_sp | ) |
Definition at line 65 of file SourceManager.cpp.
|
default |
|
privatedelete |
|
inline |
Definition at line 164 of file SourceManager.h.
References GetFile(), and m_last_file_spec.
size_t SourceManager::DisplayMoreWithLineNumbers | ( | Stream * | s, |
uint32_t | count, | ||
bool | reverse, | ||
const SymbolContextList * | bp_locs = nullptr |
||
) |
Definition at line 331 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 | ( | const FileSpec & | file, |
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 307 of file SourceManager.cpp.
References DisplaySourceLinesWithLineNumbersUsingLastFile(), GetFile(), GetLastFile(), m_last_file_spec, and m_last_line.
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 217 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(), should_show_stop_column_with_caret(), should_show_stop_line_with_ansi(), and UINT32_MAX.
Referenced by DisplayMoreWithLineNumbers(), DisplaySourceLinesWithLineNumbers(), and CommandObjectSourceList::DoExecute().
void SourceManager::FindLinesMatchingRegex | ( | FileSpec & | file_spec, |
RegularExpression & | regex, | ||
uint32_t | start_line, | ||
uint32_t | end_line, | ||
std::vector< uint32_t > & | match_lines | ||
) |
Definition at line 434 of file SourceManager.cpp.
References GetFile().
bool SourceManager::GetDefaultFileAndLine | ( | FileSpec & | file_spec, |
uint32_t & | line | ||
) |
Definition at line 390 of file SourceManager.cpp.
References lldb_private::Module::FindFunctions(), lldb_private::LineEntry::GetFile(), GetLastFile(), lldb_private::ModuleFunctionSearchOptions::include_inlines, lldb_private::ModuleFunctionSearchOptions::include_symbols, lldb_private::LineEntry::line, m_default_set, m_last_file_spec, m_last_line, m_target_wp, and SetDefaultFileAndLine().
Referenced by DisplayMoreWithLineNumbers(), DisplaySourceLinesWithLineNumbersUsingLastFile(), CommandObjectBreakpointSet::GetDefaultFile(), and lldb_private::REPL::RunLoop().
SourceManager::FileSP SourceManager::GetFile | ( | const FileSpec & | file_spec | ) |
Definition at line 77 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 142 of file SourceManager.h.
References GetFile(), and m_last_file_spec.
Referenced by DisplayMoreWithLineNumbers(), DisplaySourceLinesWithLineNumbers(), DisplaySourceLinesWithLineNumbersUsingLastFile(), CommandObjectSourceList::DoExecute(), and GetDefaultFileAndLine().
|
privatedelete |
bool SourceManager::SetDefaultFileAndLine | ( | const FileSpec & | file_spec, |
uint32_t | line | ||
) |
Definition at line 376 of file SourceManager.cpp.
References GetFile(), m_default_set, m_last_file_spec, and m_last_line.
Referenced by GetDefaultFileAndLine(), lldb_private::REPL::IOHandlerInputComplete(), and lldb_private::REPL::RunLoop().
|
protected |
Definition at line 180 of file SourceManager.h.
Referenced by lldb_private::SourceManager::File::DisplaySourceLines(), DisplaySourceLinesWithLineNumbersUsingLastFile(), and GetFile().
|
protected |
Definition at line 178 of file SourceManager.h.
Referenced by DisplayMoreWithLineNumbers(), DisplaySourceLinesWithLineNumbersUsingLastFile(), GetDefaultFileAndLine(), and SetDefaultFileAndLine().
|
protected |
Definition at line 177 of file SourceManager.h.
Referenced by DisplayMoreWithLineNumbers(), and DisplaySourceLinesWithLineNumbersUsingLastFile().
|
protected |
Definition at line 175 of file SourceManager.h.
Referenced by DefaultFileAndLineSet(), DisplaySourceLinesWithLineNumbers(), GetDefaultFileAndLine(), GetLastFile(), and SetDefaultFileAndLine().
|
protected |
Definition at line 176 of file SourceManager.h.
Referenced by DisplayMoreWithLineNumbers(), DisplaySourceLinesWithLineNumbers(), DisplaySourceLinesWithLineNumbersUsingLastFile(), GetDefaultFileAndLine(), and SetDefaultFileAndLine().
|
protected |
Definition at line 179 of file SourceManager.h.
Referenced by GetDefaultFileAndLine(), GetFile(), and lldb_private::SourceManager::File::PathRemappingIsStale().