|
LLDB mainline
|
#include <SourceManager.h>
Public Member Functions | |
| File (SupportFileNSP support_file_nsp, lldb::TargetSP target_sp) | |
| File (SupportFileNSP support_file_nsp, 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, lldb::LanguageType language_type=lldb::eLanguageTypeUnknown) |
| 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) |
| SupportFileNSP | 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 (SupportFileNSP support_file_nsp) |
| Set file and update modification time. | |
| bool | CalculateLineOffsets (uint32_t line=UINT32_MAX) |
Protected Attributes | |
| SupportFileNSP | m_support_file_nsp |
| 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 (SupportFileNSP support_file_nsp, lldb::TargetSP target_sp) |
| void | CommonInitializerImpl (SupportFileNSP support_file_nsp, lldb::TargetSP target_sp) |
Friends | |
| bool | operator== (const SourceManager::File &lhs, const SourceManager::File &rhs) |
Definition at line 37 of file SourceManager.h.
|
protected |
Definition at line 106 of file SourceManager.h.
| SourceManager::File::File | ( | SupportFileNSP | support_file_nsp, |
| lldb::TargetSP | target_sp ) |
Definition at line 464 of file SourceManager.cpp.
References CommonInitializer(), m_checksum, m_debugger_wp, m_mod_time, m_support_file_nsp, and m_target_wp.
| lldb_private::SourceManager::File::File | ( | SupportFileNSP | support_file_nsp, |
| lldb::DebuggerSP | debugger_sp ) |
References lldb::eLanguageTypeUnknown.
|
protected |
Definition at line 767 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 480 of file SourceManager.cpp.
References CommonInitializerImpl().
Referenced by File().
|
private |
Definition at line 502 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_nsp, and SetSupportFile().
Referenced by CommonInitializer().
| size_t SourceManager::File::DisplaySourceLines | ( | uint32_t | line, |
| std::optional< size_t > | column, | ||
| uint32_t | context_before, | ||
| uint32_t | context_after, | ||
| Stream * | s, | ||
| lldb::LanguageType | language_type = lldb::eLanguageTypeUnknown ) |
Definition at line 679 of file SourceManager.cpp.
References 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 738 of file SourceManager.cpp.
References lldb_private::RegularExpression::Execute(), GetLine(), LineIsValid(), and UINT32_MAX.
|
inline |
Definition at line 77 of file SourceManager.h.
References m_checksum.
|
inline |
Definition at line 79 of file SourceManager.h.
References m_checksum_warning_once_flag.
| bool SourceManager::File::GetLine | ( | uint32_t | line_no, |
| std::string & | buffer ) |
Definition at line 820 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 623 of file SourceManager.cpp.
References GetLineOffset(), LineIsValid(), m_data_sp, and UINT32_MAX.
| uint32_t SourceManager::File::GetLineOffset | ( | uint32_t | line | ) |
Definition at line 592 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 606 of file SourceManager.cpp.
References CalculateLineOffsets(), and m_offsets.
|
inline |
Definition at line 67 of file SourceManager.h.
References m_source_map_mod_id.
Referenced by PathRemappingIsStale().
|
inline |
Definition at line 62 of file SourceManager.h.
References m_support_file_nsp.
Referenced by DisplaySourceLines(), and lldb_private::operator==().
|
inline |
Definition at line 75 of file SourceManager.h.
References m_mod_time.
| bool SourceManager::File::LineIsValid | ( | uint32_t | line | ) |
Definition at line 653 of file SourceManager.cpp.
References CalculateLineOffsets(), and m_offsets.
Referenced by FindLinesMatchingRegex(), GetLine(), GetLineLength(), and PeekLineData().
| bool SourceManager::File::ModificationTimeIsStale | ( | ) | const |
Definition at line 662 of file SourceManager.cpp.
References lldb_private::FileSystem::GetModificationTime(), lldb_private::FileSystem::Instance(), m_mod_time, and m_support_file_nsp.
| bool SourceManager::File::PathRemappingIsStale | ( | ) | const |
Definition at line 672 of file SourceManager.cpp.
References GetSourceMapModificationID(), and m_target_wp.
| const char * SourceManager::File::PeekLineData | ( | uint32_t | line | ) |
Definition at line 611 of file SourceManager.cpp.
References GetLineOffset(), LineIsValid(), and m_data_sp.
|
protected |
Set file and update modification time.
Definition at line 584 of file SourceManager.cpp.
References lldb_private::FileSystem::GetModificationTime(), lldb_private::FileSystem::Instance(), m_mod_time, m_support_file_nsp, and resolve_tilde().
Referenced by CommonInitializerImpl().
|
friend |
|
protected |
Keep track of the on-disk checksum.
Definition at line 94 of file SourceManager.h.
Referenced by CommonInitializerImpl(), File(), and GetChecksum().
|
protected |
Once flag for emitting a checksum mismatch warning.
Definition at line 97 of file SourceManager.h.
Referenced by GetChecksumWarningOnceFlag().
|
protected |
Definition at line 105 of file SourceManager.h.
Referenced by CalculateLineOffsets(), CommonInitializerImpl(), DisplaySourceLines(), GetLine(), GetLineLength(), and PeekLineData().
|
protected |
Definition at line 108 of file SourceManager.h.
Referenced by DisplaySourceLines(), and File().
|
protected |
Definition at line 100 of file SourceManager.h.
Referenced by CommonInitializerImpl(), File(), GetTimestamp(), ModificationTimeIsStale(), lldb_private::operator==(), and SetSupportFile().
|
protected |
Definition at line 107 of file SourceManager.h.
Referenced by CalculateLineOffsets(), GetLineOffset(), GetNumLines(), and LineIsValid().
|
protected |
Definition at line 104 of file SourceManager.h.
Referenced by CommonInitializerImpl(), 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 91 of file SourceManager.h.
Referenced by CommonInitializerImpl(), File(), GetSupportFile(), ModificationTimeIsStale(), and SetSupportFile().
|
protected |
Definition at line 109 of file SourceManager.h.
Referenced by File(), and PathRemappingIsStale().