LLDB mainline
lldb_private::SourceManager::File Class Reference

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

Detailed Description

Definition at line 37 of file SourceManager.h.

Member Typedef Documentation

◆ LineOffsets

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

Definition at line 105 of file SourceManager.h.

Constructor & Destructor Documentation

◆ File() [1/2]

SourceManager::File::File ( SupportFileNSP support_file_nsp,
lldb::TargetSP target_sp )

◆ File() [2/2]

lldb_private::SourceManager::File::File ( SupportFileNSP support_file_nsp,
lldb::DebuggerSP debugger_sp )

Member Function Documentation

◆ CalculateLineOffsets()

bool SourceManager::File::CalculateLineOffsets ( uint32_t line = UINT32_MAX)
protected

Definition at line 758 of file SourceManager.cpp.

References is_newline_char(), m_data_sp, m_offsets, and UINT32_MAX.

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

◆ CommonInitializer()

void SourceManager::File::CommonInitializer ( SupportFileNSP support_file_nsp,
lldb::TargetSP target_sp )
private

Definition at line 477 of file SourceManager.cpp.

References CommonInitializerImpl().

Referenced by File().

◆ CommonInitializerImpl()

◆ 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 76 of file SourceManager.h.

References m_checksum.

◆ GetChecksumWarningOnceFlag()

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

Definition at line 78 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 811 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 614 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 599 of file SourceManager.cpp.

References CalculateLineOffsets(), and m_offsets.

◆ GetSourceMapModificationID()

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

Definition at line 66 of file SourceManager.h.

References m_source_map_mod_id.

Referenced by PathRemappingIsStale().

◆ GetSupportFile()

SupportFileNSP lldb_private::SourceManager::File::GetSupportFile ( ) const
inline

Definition at line 61 of file SourceManager.h.

References m_support_file_nsp.

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

◆ GetTimestamp()

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

Definition at line 74 of file SourceManager.h.

References m_mod_time.

◆ LineIsValid()

bool SourceManager::File::LineIsValid ( uint32_t line)

Definition at line 642 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 661 of file SourceManager.cpp.

References GetSourceMapModificationID(), and m_target_wp.

◆ PeekLineData()

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

Definition at line 604 of file SourceManager.cpp.

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

◆ SetSupportFile()

void SourceManager::File::SetSupportFile ( SupportFileNSP support_file_nsp)
protected

◆ 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 93 of file SourceManager.h.

Referenced by CommonInitializerImpl(), 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 96 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 107 of file SourceManager.h.

Referenced by DisplaySourceLines(), 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 106 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 103 of file SourceManager.h.

Referenced by CommonInitializerImpl(), and GetSourceMapModificationID().

◆ m_support_file_nsp

SupportFileNSP lldb_private::SourceManager::File::m_support_file_nsp
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 90 of file SourceManager.h.

Referenced by CommonInitializerImpl(), File(), GetSupportFile(), ModificationTimeIsStale(), and SetSupportFile().

◆ m_target_wp

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

Definition at line 108 of file SourceManager.h.

Referenced by File(), and PathRemappingIsStale().


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