LLDB mainline
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
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 
)

Definition at line 473 of file SourceManager.cpp.

References CommonInitializer().

◆ File() [2/2]

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

Definition at line 466 of file SourceManager.cpp.

References CommonInitializer().

Member Function Documentation

◆ CalculateLineOffsets()

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

Definition at line 741 of file SourceManager.cpp.

References is_newline_char(), and UINT32_MAX.

◆ CommonInitializer()

void SourceManager::File::CommonInitializer ( lldb::SupportFileSP  support_file_sp,
lldb::TargetSP  target_sp 
)
private

◆ DisplaySourceLines()

size_t SourceManager::File::DisplaySourceLines ( uint32_t  line,
std::optional< size_t >  column,
uint32_t  context_before,
uint32_t  context_after,
Stream s 
)

◆ FindLinesMatchingRegex()

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

Definition at line 712 of file SourceManager.cpp.

References lldb_private::RegularExpression::Execute(), and UINT32_MAX.

◆ 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 794 of file SourceManager.cpp.

References UINT32_MAX.

◆ GetLineLength()

uint32_t SourceManager::File::GetLineLength ( uint32_t  line,
bool  include_newline_chars 
)

Definition at line 597 of file SourceManager.cpp.

References UINT32_MAX.

◆ GetLineOffset()

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

Definition at line 568 of file SourceManager.cpp.

References UINT32_MAX.

◆ GetNumLines()

uint32_t SourceManager::File::GetNumLines ( )

Definition at line 582 of file SourceManager.cpp.

◆ GetSourceMapModificationID()

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

Definition at line 65 of file SourceManager.h.

References m_source_map_mod_id.

◆ 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 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 625 of file SourceManager.cpp.

◆ ModificationTimeIsStale()

bool SourceManager::File::ModificationTimeIsStale ( ) const

◆ PathRemappingIsStale()

bool SourceManager::File::PathRemappingIsStale ( ) const

Definition at line 644 of file SourceManager.cpp.

References lldb_private::SourceManager::m_target_wp.

◆ PeekLineData()

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

Definition at line 587 of file SourceManager.cpp.

◆ SetSupportFile()

void SourceManager::File::SetSupportFile ( lldb::SupportFileSP  support_file_sp)
protected

Set file and update modification time.

Definition at line 560 of file SourceManager.cpp.

References lldb_private::FileSystem::GetModificationTime(), lldb_private::FileSystem::Instance(), and resolve_tilde().

Friends And Related Function Documentation

◆ 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 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

Definition at line 103 of file SourceManager.h.

◆ m_debugger_wp

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

Definition at line 106 of file SourceManager.h.

◆ m_mod_time

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

Definition at line 98 of file SourceManager.h.

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

◆ m_offsets

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

Definition at line 105 of file SourceManager.h.

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

◆ m_target_wp

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

Definition at line 107 of file SourceManager.h.


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