9#ifndef LLDB_CORE_SOURCEMANAGER_H
10#define LLDB_CORE_SOURCEMANAGER_H
16#include "llvm/Support/Chrono.h"
29class SymbolContextList;
40 File(
const FileSpec &file_spec, lldb::DebuggerSP debugger_sp);
50 std::vector<uint32_t> &match_lines);
92 typedef std::shared_ptr<File>
FileSP;
129 const char *current_line_cstr,
Stream *s,
135 const char *current_line_cstr,
Stream *s,
151 std::vector<uint32_t> &match_lines);
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)
const FileSpec & GetFileSpec()
std::vector< uint32_t > LineOffsets
const char * PeekLineData(uint32_t line)
bool LineIsValid(uint32_t line)
uint32_t GetLineLength(uint32_t line, bool include_newline_chars)
bool CalculateLineOffsets(uint32_t line=UINT32_MAX)
lldb::DataBufferSP m_data_sp
void CommonInitializer(const FileSpec &file_spec, Target *target)
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)
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)
FileSpec m_file_spec_orig
FileSP FindSourceFile(const FileSpec &file_spec) const
SourceFileCache()=default
~SourceFileCache()=default
void AddSourceFile(const FileSP &file_sp)
std::map< FileSpec, FileSP > FileCache
bool DefaultFileAndLineSet()
SourceManager(const SourceManager &)=delete
FileSpec m_last_file_spec
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)
bool SetDefaultFileAndLine(const FileSpec &file_spec, uint32_t line)
std::shared_ptr< File > FileSP
const SourceManager & operator=(const SourceManager &)=delete
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)
SourceManager(const lldb::DebuggerSP &debugger_sp)
SourceManager(const lldb::TargetSP &target_sp)
lldb::DebuggerWP m_debugger_wp
lldb::TargetWP m_target_wp
void FindLinesMatchingRegex(FileSpec &file_spec, RegularExpression ®ex, uint32_t start_line, uint32_t end_line, std::vector< uint32_t > &match_lines)
bool GetDefaultFileAndLine(FileSpec &file_spec, uint32_t &line)
FileSP GetFile(const FileSpec &file_spec)
size_t DisplayMoreWithLineNumbers(Stream *s, uint32_t count, bool reverse, 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)