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 (const FileSpec &file_spec, lldb::TargetSP target_sp)
 File (const FileSpec &file_spec, 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)
const FileSpecGetFileSpec ()
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

Protected Types

typedef std::vector< uint32_t > LineOffsets

Protected Member Functions

void SetFileSpec (FileSpec file_spec)
 Set file and update modification time.
bool CalculateLineOffsets (uint32_t line=UINT32_MAX)

Protected Attributes

FileSpec m_file_spec_orig
FileSpec m_file_spec
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 (const FileSpec &file_spec, lldb::TargetSP target_sp)


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

Detailed Description

Definition at line 35 of file SourceManager.h.

Member Typedef Documentation

◆ LineOffsets

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

Definition at line 90 of file SourceManager.h.

Constructor & Destructor Documentation

◆ File() [1/2]

SourceManager::File::File ( const FileSpec file_spec,
lldb::TargetSP  target_sp 

Definition at line 454 of file SourceManager.cpp.

References CommonInitializer().

◆ File() [2/2]

SourceManager::File::File ( const FileSpec file_spec,
lldb::DebuggerSP  debugger_sp 

Definition at line 447 of file SourceManager.cpp.

References CommonInitializer().

Member Function Documentation

◆ CalculateLineOffsets()

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

Definition at line 706 of file SourceManager.cpp.

References is_newline_char(), and UINT32_MAX.

◆ CommonInitializer()

void SourceManager::File::CommonInitializer ( const FileSpec file_spec,
lldb::TargetSP  target_sp 

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

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

◆ GetFileSpec()

const FileSpec & lldb_private::SourceManager::File::GetFileSpec ( )

Definition at line 59 of file SourceManager.h.

References m_file_spec.

◆ GetLine()

bool SourceManager::File::GetLine ( uint32_t  line_no,
std::string &  buffer 

Definition at line 759 of file SourceManager.cpp.

References UINT32_MAX.

◆ GetLineLength()

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

Definition at line 565 of file SourceManager.cpp.

References UINT32_MAX.

◆ GetLineOffset()

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

Definition at line 536 of file SourceManager.cpp.

References UINT32_MAX.

◆ GetNumLines()

uint32_t SourceManager::File::GetNumLines ( )

Definition at line 550 of file SourceManager.cpp.

◆ GetSourceMapModificationID()

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

Definition at line 61 of file SourceManager.h.

References m_source_map_mod_id.

◆ GetTimestamp()

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

Definition at line 69 of file SourceManager.h.

References m_mod_time.

◆ LineIsValid()

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

Definition at line 593 of file SourceManager.cpp.

◆ ModificationTimeIsStale()

bool SourceManager::File::ModificationTimeIsStale ( ) const

◆ PathRemappingIsStale()

bool SourceManager::File::PathRemappingIsStale ( ) const

Definition at line 611 of file SourceManager.cpp.

References lldb_private::SourceManager::m_target_wp.

◆ PeekLineData()

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

Definition at line 555 of file SourceManager.cpp.

◆ SetFileSpec()

void SourceManager::File::SetFileSpec ( FileSpec  file_spec)

Set file and update modification time.

Definition at line 530 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 

Member Data Documentation

◆ m_data_sp

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

Definition at line 89 of file SourceManager.h.

◆ m_debugger_wp

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

Definition at line 92 of file SourceManager.h.

◆ m_file_spec

FileSpec lldb_private::SourceManager::File::m_file_spec

Definition at line 79 of file SourceManager.h.

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

◆ m_file_spec_orig

FileSpec lldb_private::SourceManager::File::m_file_spec_orig

Definition at line 77 of file SourceManager.h.

◆ m_mod_time

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

Definition at line 84 of file SourceManager.h.

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

◆ m_offsets

LineOffsets lldb_private::SourceManager::File::m_offsets

Definition at line 91 of file SourceManager.h.

◆ m_source_map_mod_id

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

Definition at line 88 of file SourceManager.h.

Referenced by GetSourceMapModificationID().

◆ m_target_wp

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

Definition at line 93 of file SourceManager.h.

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