9#ifndef LLDB_CORE_SOURCEMANAGER_H
10#define LLDB_CORE_SOURCEMANAGER_H
17#include "llvm/Support/Chrono.h"
18#include "llvm/Support/RWMutex.h"
31class SymbolContextList;
48 uint32_t context_before, uint32_t context_after,
52 std::vector<uint32_t> &match_lines);
54 bool GetLine(uint32_t line_no, std::string &buffer);
69 uint32_t
GetLineLength(uint32_t line,
bool include_newline_chars);
161 uint32_t context_before, uint32_t context_after,
162 const char *current_line_cstr,
Stream *s,
167 uint32_t start_line, uint32_t count, uint32_t curr_line, uint32_t column,
168 const char *current_line_cstr,
Stream *s,
193 std::vector<uint32_t> &match_lines);
lldb::TargetWP m_target_wp
bool ModificationTimeIsStale() const
std::once_flag & GetChecksumWarningOnceFlag()
llvm::sys::TimePoint m_mod_time
uint32_t GetSourceMapModificationID() const
void FindLinesMatchingRegex(RegularExpression ®ex, uint32_t start_line, uint32_t end_line, std::vector< uint32_t > &match_lines)
std::vector< uint32_t > LineOffsets
const char * PeekLineData(uint32_t line)
bool LineIsValid(uint32_t line)
Checksum m_checksum
Keep track of the on-disk checksum.
bool PathRemappingIsStale() const
uint32_t GetLineLength(uint32_t line, bool include_newline_chars)
bool CalculateLineOffsets(uint32_t line=UINT32_MAX)
lldb::DataBufferSP m_data_sp
lldb::SupportFileSP GetSupportFile() const
void CommonInitializer(lldb::SupportFileSP support_file_sp, lldb::TargetSP target_sp)
lldb::DebuggerWP m_debugger_wp
friend bool operator==(const SourceManager::File &lhs, const SourceManager::File &rhs)
bool GetLine(uint32_t line_no, std::string &buffer)
uint32_t GetLineOffset(uint32_t line)
void SetSupportFile(lldb::SupportFileSP support_file_sp)
Set file and update modification time.
const Checksum & GetChecksum() const
uint32_t m_source_map_mod_id
size_t DisplaySourceLines(uint32_t line, std::optional< size_t > column, uint32_t context_before, uint32_t context_after, Stream *s)
lldb::SupportFileSP m_support_file_sp
The support file.
llvm::sys::TimePoint GetTimestamp() const
std::once_flag m_checksum_warning_once_flag
Once flag for emitting a checksum mismatch warning.
The SourceFileCache class separates the source manager from the cache of source files.
void AddSourceFileImpl(const FileSpec &file_spec, FileSP file_sp)
void RemoveSourceFile(const FileSP &file_sp)
FileSP FindSourceFile(const FileSpec &file_spec) const
SourceFileCache()=default
~SourceFileCache()=default
llvm::sys::RWMutex m_mutex
void Dump(Stream &stream) const
void AddSourceFile(const FileSpec &file_spec, FileSP file_sp)
std::map< FileSpec, FileSP > FileCache
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)
SourceManager(const SourceManager &)=delete
bool SetDefaultFileAndLine(lldb::SupportFileSP support_file_sp, uint32_t line)
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)
std::shared_ptr< File > FileSP
const SourceManager & operator=(const SourceManager &)=delete
std::optional< SupportFileAndLine > GetDefaultFileAndLine()
lldb::SupportFileSP m_last_support_file_sp
lldb::DebuggerWP m_debugger_wp
lldb::TargetWP m_target_wp
FileSP GetFile(lldb::SupportFileSP support_file_sp)
size_t DisplayMoreWithLineNumbers(Stream *s, uint32_t count, bool reverse, const SymbolContextList *bp_locs=nullptr)
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)
A stream class that can stream formatted output to a file.
Defines a list of symbol context objects.
A class that represents a running process on the host machine.
bool operator==(const Address &lhs, const Address &rhs)
std::shared_ptr< lldb_private::SupportFile > SupportFileSP
std::weak_ptr< lldb_private::Debugger > DebuggerWP
std::shared_ptr< lldb_private::Debugger > DebuggerSP
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::weak_ptr< lldb_private::Target > TargetWP
std::shared_ptr< lldb_private::Target > TargetSP
lldb::SupportFileSP support_file_sp
SupportFileAndLine(lldb::SupportFileSP support_file_sp, uint32_t line)