LLDB mainline
lldb_private::SourceManager::File Class Reference

#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 &regex, 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 ChecksumGetChecksum () 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)

Detailed Description

Definition at line 36 of file SourceManager.h.

Member Typedef Documentation

◆ LineOffsets

typedef std::vector<uint32_t> lldb_private::SourceManager::File::LineOffsets
protected

Definition at line 104 of file SourceManager.h.

Constructor & Destructor Documentation

◆ File() [1/2]

SourceManager::File::File ( lldb::SupportFileSP support_file_sp,
lldb::TargetSP target_sp )

◆ File() [2/2]

SourceManager::File::File ( lldb::SupportFileSP support_file_sp,
lldb::DebuggerSP debugger_sp )

Member Function Documentation

◆ CalculateLineOffsets()

bool SourceManager::File::CalculateLineOffsets ( uint32_t line = UINT32_MAX)
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().

◆ CommonInitializer()

◆ DisplaySourceLines()

◆ FindLinesMatchingRegex()

void SourceManager::File::FindLinesMatchingRegex ( RegularExpression & regex,
uint32_t start_line,
uint32_t end_line,
std::vector< uint32_t > & match_lines )

◆ GetChecksum()

const Checksum & lldb_private::SourceManager::File::GetChecksum ( ) const
inline

Definition at line 75 of file SourceManager.h.

References m_checksum.

◆ GetChecksumWarningOnceFlag()

std::once_flag & lldb_private::SourceManager::File::GetChecksumWarningOnceFlag ( )
inline

Definition at line 77 of file SourceManager.h.

References m_checksum_warning_once_flag.

◆ GetLine()

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().

◆ GetLineLength()

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.

◆ GetLineOffset()

uint32_t SourceManager::File::GetLineOffset ( uint32_t line)

◆ GetNumLines()

uint32_t SourceManager::File::GetNumLines ( )

Definition at line 578 of file SourceManager.cpp.

References CalculateLineOffsets(), and m_offsets.

◆ GetSourceMapModificationID()

uint32_t lldb_private::SourceManager::File::GetSourceMapModificationID ( ) const
inline

Definition at line 65 of file SourceManager.h.

References m_source_map_mod_id.

Referenced by PathRemappingIsStale().

◆ GetSupportFile()

lldb::SupportFileSP lldb_private::SourceManager::File::GetSupportFile ( ) const
inline

Definition at line 60 of file SourceManager.h.

References m_support_file_sp.

Referenced by DisplaySourceLines(), and lldb_private::operator==().

◆ GetTimestamp()

llvm::sys::TimePoint lldb_private::SourceManager::File::GetTimestamp ( ) const
inline

Definition at line 73 of file SourceManager.h.

References m_mod_time.

◆ LineIsValid()

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().

◆ ModificationTimeIsStale()

bool SourceManager::File::ModificationTimeIsStale ( ) const

◆ PathRemappingIsStale()

bool SourceManager::File::PathRemappingIsStale ( ) const

Definition at line 640 of file SourceManager.cpp.

References GetSourceMapModificationID(), and m_target_wp.

◆ PeekLineData()

const char * SourceManager::File::PeekLineData ( uint32_t line)

Definition at line 583 of file SourceManager.cpp.

References GetLineOffset(), LineIsValid(), and m_data_sp.

◆ SetSupportFile()

void SourceManager::File::SetSupportFile ( lldb::SupportFileSP support_file_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().

◆ operator==

bool operator== ( const SourceManager::File & lhs,
const SourceManager::File & rhs )
friend

Member Data Documentation

◆ m_checksum

Checksum lldb_private::SourceManager::File::m_checksum
protected

Keep track of the on-disk checksum.

Definition at line 92 of file SourceManager.h.

Referenced by CommonInitializer(), File(), File(), and GetChecksum().

◆ m_checksum_warning_once_flag

std::once_flag lldb_private::SourceManager::File::m_checksum_warning_once_flag
protected

Once flag for emitting a checksum mismatch warning.

Definition at line 95 of file SourceManager.h.

Referenced by GetChecksumWarningOnceFlag().

◆ m_data_sp

lldb::DataBufferSP lldb_private::SourceManager::File::m_data_sp
protected

◆ m_debugger_wp

lldb::DebuggerWP lldb_private::SourceManager::File::m_debugger_wp
protected

Definition at line 106 of file SourceManager.h.

Referenced by DisplaySourceLines(), File(), and File().

◆ m_mod_time

llvm::sys::TimePoint lldb_private::SourceManager::File::m_mod_time
protected

◆ m_offsets

LineOffsets lldb_private::SourceManager::File::m_offsets
protected

Definition at line 105 of file SourceManager.h.

Referenced by CalculateLineOffsets(), GetLineOffset(), GetNumLines(), and LineIsValid().

◆ m_source_map_mod_id

uint32_t lldb_private::SourceManager::File::m_source_map_mod_id = 0
protected

Definition at line 102 of file SourceManager.h.

Referenced by CommonInitializer(), and GetSourceMapModificationID().

◆ m_support_file_sp

lldb::SupportFileSP lldb_private::SourceManager::File::m_support_file_sp
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().

◆ m_target_wp

lldb::TargetWP lldb_private::SourceManager::File::m_target_wp
protected

Definition at line 107 of file SourceManager.h.

Referenced by File(), File(), and PathRemappingIsStale().


The documentation for this class was generated from the following files: