LLDB mainline
|
#include <SourceManager.h>
Public Member Functions | |
File (lldb::SupportFileSP support_file_sp, lldb::TargetSP target_sp) | |
File (lldb::SupportFileSP support_file_sp, lldb::DebuggerSP debugger_sp) | |
bool | ModificationTimeIsStale () const |
bool | PathRemappingIsStale () const |
size_t | DisplaySourceLines (uint32_t line, std::optional< size_t > column, uint32_t context_before, uint32_t context_after, Stream *s) |
void | FindLinesMatchingRegex (RegularExpression ®ex, uint32_t start_line, uint32_t end_line, std::vector< uint32_t > &match_lines) |
bool | GetLine (uint32_t line_no, std::string &buffer) |
uint32_t | GetLineOffset (uint32_t line) |
bool | LineIsValid (uint32_t line) |
lldb::SupportFileSP | GetSupportFile () const |
uint32_t | GetSourceMapModificationID () const |
const char * | PeekLineData (uint32_t line) |
uint32_t | GetLineLength (uint32_t line, bool include_newline_chars) |
uint32_t | GetNumLines () |
llvm::sys::TimePoint | GetTimestamp () const |
const Checksum & | GetChecksum () const |
std::once_flag & | GetChecksumWarningOnceFlag () |
Protected Types | |
typedef std::vector< uint32_t > | LineOffsets |
Protected Member Functions | |
void | SetSupportFile (lldb::SupportFileSP support_file_sp) |
Set file and update modification time. | |
bool | CalculateLineOffsets (uint32_t line=UINT32_MAX) |
Protected Attributes | |
lldb::SupportFileSP | m_support_file_sp |
The support file. | |
Checksum | m_checksum |
Keep track of the on-disk checksum. | |
std::once_flag | m_checksum_warning_once_flag |
Once flag for emitting a checksum mismatch warning. | |
llvm::sys::TimePoint | m_mod_time |
uint32_t | m_source_map_mod_id = 0 |
lldb::DataBufferSP | m_data_sp |
LineOffsets | m_offsets |
lldb::DebuggerWP | m_debugger_wp |
lldb::TargetWP | m_target_wp |
Private Member Functions | |
void | CommonInitializer (lldb::SupportFileSP support_file_sp, lldb::TargetSP target_sp) |
Friends | |
bool | operator== (const SourceManager::File &lhs, const SourceManager::File &rhs) |
Definition at line 36 of file SourceManager.h.
|
protected |
Definition at line 104 of file SourceManager.h.
SourceManager::File::File | ( | lldb::SupportFileSP | support_file_sp, |
lldb::TargetSP | target_sp ) |
Definition at line 469 of file SourceManager.cpp.
References CommonInitializer(), m_checksum, m_debugger_wp, m_mod_time, m_support_file_sp, and m_target_wp.
SourceManager::File::File | ( | lldb::SupportFileSP | support_file_sp, |
lldb::DebuggerSP | debugger_sp ) |
Definition at line 462 of file SourceManager.cpp.
References CommonInitializer(), m_checksum, m_debugger_wp, m_mod_time, m_support_file_sp, and m_target_wp.
|
protected |
Definition at line 737 of file SourceManager.cpp.
References is_newline_char(), m_data_sp, m_offsets, and UINT32_MAX.
Referenced by GetLineOffset(), GetNumLines(), and LineIsValid().
|
private |
Definition at line 478 of file SourceManager.cpp.
References lldb_private::ConstString::AsCString(), lldb_private::SymbolContext::comp_unit, lldb_private::FileSystem::CreateDataBuffer(), lldb_private::SymbolContextList::GetContextAtIndex(), lldb_private::FileSpec::GetDirectory(), lldb_private::FileSpec::GetFilename(), lldb_private::CompileUnit::GetPrimarySupportFile(), lldb_private::FileSystem::Instance(), m_checksum, m_data_sp, m_mod_time, m_source_map_mod_id, m_support_file_sp, and SetSupportFile().
size_t SourceManager::File::DisplaySourceLines | ( | uint32_t | line, |
std::optional< size_t > | column, | ||
uint32_t | context_before, | ||
uint32_t | context_after, | ||
Stream * | s ) |
Definition at line 647 of file SourceManager.cpp.
References lldb::eLanguageTypeUnknown, lldb_private::Stream::EOL(), lldb_private::HighlighterManager::getHighlighterFor(), GetLineOffset(), GetSupportFile(), lldb_private::Stream::GetWrittenBytes(), is_newline_char(), m_data_sp, m_debugger_wp, lldb_private::HighlightStyle::MakeVimStyle(), lldb_private::HighlightStyle::selected, lldb_private::HighlightStyle::ColorStyle::Set(), should_highlight_source(), should_show_stop_column_with_ansi(), and UINT32_MAX.
void SourceManager::File::FindLinesMatchingRegex | ( | RegularExpression & | regex, |
uint32_t | start_line, | ||
uint32_t | end_line, | ||
std::vector< uint32_t > & | match_lines ) |
Definition at line 708 of file SourceManager.cpp.
References lldb_private::RegularExpression::Execute(), GetLine(), LineIsValid(), and UINT32_MAX.
|
inline |
Definition at line 75 of file SourceManager.h.
References m_checksum.
|
inline |
Definition at line 77 of file SourceManager.h.
References m_checksum_warning_once_flag.
bool SourceManager::File::GetLine | ( | uint32_t | line_no, |
std::string & | buffer ) |
Definition at line 790 of file SourceManager.cpp.
References GetLineOffset(), LineIsValid(), m_data_sp, and UINT32_MAX.
Referenced by FindLinesMatchingRegex().
uint32_t SourceManager::File::GetLineLength | ( | uint32_t | line, |
bool | include_newline_chars ) |
Definition at line 593 of file SourceManager.cpp.
References GetLineOffset(), LineIsValid(), m_data_sp, and UINT32_MAX.
uint32_t SourceManager::File::GetLineOffset | ( | uint32_t | line | ) |
Definition at line 564 of file SourceManager.cpp.
References CalculateLineOffsets(), m_offsets, and UINT32_MAX.
Referenced by DisplaySourceLines(), GetLine(), GetLineLength(), and PeekLineData().
uint32_t SourceManager::File::GetNumLines | ( | ) |
Definition at line 578 of file SourceManager.cpp.
References CalculateLineOffsets(), and m_offsets.
|
inline |
Definition at line 65 of file SourceManager.h.
References m_source_map_mod_id.
Referenced by PathRemappingIsStale().
|
inline |
Definition at line 60 of file SourceManager.h.
References m_support_file_sp.
Referenced by DisplaySourceLines(), and lldb_private::operator==().
|
inline |
Definition at line 73 of file SourceManager.h.
References m_mod_time.
bool SourceManager::File::LineIsValid | ( | uint32_t | line | ) |
Definition at line 621 of file SourceManager.cpp.
References CalculateLineOffsets(), and m_offsets.
Referenced by FindLinesMatchingRegex(), GetLine(), GetLineLength(), and PeekLineData().
bool SourceManager::File::ModificationTimeIsStale | ( | ) | const |
Definition at line 630 of file SourceManager.cpp.
References lldb_private::FileSystem::GetModificationTime(), lldb_private::FileSystem::Instance(), m_mod_time, and m_support_file_sp.
bool SourceManager::File::PathRemappingIsStale | ( | ) | const |
Definition at line 640 of file SourceManager.cpp.
References GetSourceMapModificationID(), and m_target_wp.
const char * SourceManager::File::PeekLineData | ( | uint32_t | line | ) |
Definition at line 583 of file SourceManager.cpp.
References GetLineOffset(), LineIsValid(), and m_data_sp.
|
protected |
Set file and update modification time.
Definition at line 556 of file SourceManager.cpp.
References lldb_private::FileSystem::GetModificationTime(), lldb_private::FileSystem::Instance(), m_mod_time, m_support_file_sp, and resolve_tilde().
Referenced by CommonInitializer().
|
friend |
|
protected |
Keep track of the on-disk checksum.
Definition at line 92 of file SourceManager.h.
Referenced by CommonInitializer(), File(), File(), and GetChecksum().
|
protected |
Once flag for emitting a checksum mismatch warning.
Definition at line 95 of file SourceManager.h.
Referenced by GetChecksumWarningOnceFlag().
|
protected |
Definition at line 103 of file SourceManager.h.
Referenced by CalculateLineOffsets(), CommonInitializer(), DisplaySourceLines(), GetLine(), GetLineLength(), and PeekLineData().
|
protected |
Definition at line 106 of file SourceManager.h.
Referenced by DisplaySourceLines(), File(), and File().
|
protected |
Definition at line 98 of file SourceManager.h.
Referenced by CommonInitializer(), File(), File(), GetTimestamp(), ModificationTimeIsStale(), lldb_private::operator==(), and SetSupportFile().
|
protected |
Definition at line 105 of file SourceManager.h.
Referenced by CalculateLineOffsets(), GetLineOffset(), GetNumLines(), and LineIsValid().
|
protected |
Definition at line 102 of file SourceManager.h.
Referenced by CommonInitializer(), and GetSourceMapModificationID().
|
protected |
The support file.
If the target has source mappings, this might be different from the original support file passed to the constructor.
Definition at line 89 of file SourceManager.h.
Referenced by CommonInitializer(), File(), File(), GetSupportFile(), ModificationTimeIsStale(), and SetSupportFile().
|
protected |
Definition at line 107 of file SourceManager.h.
Referenced by File(), File(), and PathRemappingIsStale().