LLDB mainline
|
A file collection class. More...
#include "lldb/Utility/FileSpecList.h"
Public Types | |
typedef std::vector< FileSpec > | collection |
typedef collection::const_iterator | const_iterator |
Public Member Functions | |
FileSpecList () | |
Default constructor. | |
FileSpecList (const FileSpecList &rhs)=default | |
Copy constructor. | |
FileSpecList (FileSpecList &&rhs)=default | |
Move constructor. | |
FileSpecList (std::vector< FileSpec > &&rhs) | |
Initialize this object from a vector of FileSpecs. | |
~FileSpecList () | |
Destructor. | |
FileSpecList & | operator= (const FileSpecList &rhs)=default |
Assignment operator. | |
FileSpecList & | operator= (FileSpecList &&rhs)=default |
Move-assignment operator. | |
void | Append (const FileSpec &file) |
Append a FileSpec object to the list. | |
bool | AppendIfUnique (const FileSpec &file) |
Append a FileSpec object if unique. | |
template<class... Args> | |
void | EmplaceBack (Args &&...args) |
Inserts a new FileSpec into the FileSpecList constructed in-place with the given arguments. | |
void | Clear () |
Clears the file list. | |
void | Dump (Stream *s, const char *separator_cstr="\n") const |
Dumps the file list to the supplied stream pointer "s". | |
size_t | FindFileIndex (size_t idx, const FileSpec &file, bool full) const |
Find a file index. | |
size_t | FindCompatibleIndex (size_t idx, const FileSpec &file) const |
Find a compatible file index. | |
const FileSpec & | GetFileSpecAtIndex (size_t idx) const |
Get file at index. | |
const FileSpec * | GetFileSpecPointerAtIndex (size_t idx) const |
Get file specification pointer at index. | |
size_t | MemorySize () const |
Get the memory cost of this object. | |
bool | IsEmpty () const |
size_t | GetSize () const |
Get the number of files in the file list. | |
bool | Insert (size_t idx, const FileSpec &file) |
bool | Replace (size_t idx, const FileSpec &file) |
bool | Remove (size_t idx) |
const_iterator | begin () const |
const_iterator | end () const |
Static Public Member Functions | |
static size_t | GetFilesMatchingPartialPath (const char *path, bool dir_okay, FileSpecList &matches) |
Protected Attributes | |
collection | m_files |
A collection of FileSpec objects. | |
A file collection class.
A class that contains a mutable list of FileSpec objects.
Definition at line 24 of file FileSpecList.h.
typedef std::vector<FileSpec> lldb_private::FileSpecList::collection |
Definition at line 26 of file FileSpecList.h.
typedef collection::const_iterator lldb_private::FileSpecList::const_iterator |
Definition at line 27 of file FileSpecList.h.
FileSpecList::FileSpecList | ( | ) |
Default constructor.
Initialize this object with an empty file list.
Definition at line 18 of file FileSpecList.cpp.
Referenced by MemorySize().
|
default |
Copy constructor.
|
default |
Move constructor.
|
inline |
Initialize this object from a vector of FileSpecs.
Definition at line 41 of file FileSpecList.h.
|
default |
Destructor.
void FileSpecList::Append | ( | const FileSpec & | file | ) |
Append a FileSpec object to the list.
Appends file to the end of the file list.
[in] | file | A new file to append to this file list. |
Definition at line 23 of file FileSpecList.cpp.
References m_files.
Referenced by lldb_private::StructuredDataDarwinLog::AddInitCompletionHook(), lldb_private::OptionValueFileSpecList::AppendCurrentValue(), lldb::SBTarget::BreakpointCreateByName(), lldb_private::Target::CreateBreakpoint(), lldb_private::AppleObjCRuntime::CreateExceptionSearchFilter(), CommandObjectBreakpointSet::DoExecute(), SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), lldb_private::PlatformDarwin::LocateExecutableScriptingResources(), lldb_private::npdb::SymbolFileNativePDB::ParseSupportFiles(), ObjectFileMachO::ParseSymtab(), DynamicLoaderMacOS::SetNotificationBreakpoint(), DynamicLoaderDarwinKernel::SetNotificationBreakpointIfNeeded(), DynamicLoaderPOSIXDYLD::SetRendezvousBreakpoint(), and lldb_private::OptionValueFileSpecList::SetValueFromString().
bool FileSpecList::AppendIfUnique | ( | const FileSpec & | file | ) |
Append a FileSpec object if unique.
Appends file to the end of the file list if it doesn't already exist in the file list.
[in] | file | A new file to append to this file list. |
Definition at line 31 of file FileSpecList.cpp.
References end(), and m_files.
Referenced by ObjectFileELF::GetDependentModules(), ObjectFileMachO::GetDependentModules(), ObjectFilePECOFF::GetDependentModules(), GetModuleConfig(), lldb_private::Symbols::LocateExecutableSymbolFile(), SymbolFilePDB::ParseSupportFiles(), ObjectFileMachO::ParseSymtab(), CommandObjectBreakpointSet::CommandOptions::SetOptionValue(), and CommandObjectThreadJump::CommandOptions::SetOptionValue().
|
inline |
Definition at line 219 of file FileSpecList.h.
References m_files.
void FileSpecList::Clear | ( | ) |
Clears the file list.
Definition at line 41 of file FileSpecList.cpp.
References m_files.
Referenced by lldb_private::OptionValueFileSpecList::Clear(), lldb_private::ObjectFileJIT::GetDependentModules(), CommandObjectBreakpointSet::CommandOptions::OptionParsingStarting(), CommandObjectThreadJump::CommandOptions::OptionParsingStarting(), and lldb_private::OptionValueFileSpecList::SetValueFromString().
void FileSpecList::Dump | ( | Stream * | s, |
const char * | separator_cstr = "\n" |
||
) | const |
Dumps the file list to the supplied stream pointer "s".
[in] | s | The stream that will be used to dump the object description. |
Definition at line 44 of file FileSpecList.cpp.
References lldb_private::Stream::AsRawOstream(), end(), m_files, and lldb_private::Stream::PutCString().
|
inline |
Inserts a new FileSpec into the FileSpecList constructed in-place with the given arguments.
[in] | args | Arguments to create the FileSpec |
Definition at line 85 of file FileSpecList.h.
References m_files.
Referenced by lldb_private::ItaniumABILanguageRuntime::CreateExceptionSearchFilter(), lldb_private::SearchFilterByModuleListAndCU::CreateFromStructuredData(), and lldb_private::PlatformDarwin::SetThreadCreationBreakpoint().
|
inline |
Definition at line 220 of file FileSpecList.h.
References m_files.
Referenced by AppendIfUnique(), Dump(), and MemorySize().
size_t FileSpecList::FindCompatibleIndex | ( | size_t | idx, |
const FileSpec & | file | ||
) | const |
Find a compatible file index.
Find the index of a compatible file in the file spec list that matches file starting idx entries into the file spec list. A file is considered compatible if:
This is used to implement better matching for setting breakpoints in source files where an IDE might specify a full path when setting the breakpoint and debug info contains relative paths, if a user specifies a relative path when setting a breakpoint.
[in] | idx | An index into the file list. |
[in] | file | The file specification to search for. |
Definition at line 82 of file FileSpecList.cpp.
References lldb_private::FileSpec::Equal(), lldb_private::FileSpec::FileEquals(), lldb_private::FileSpec::GetDirectory(), lldb_private::ConstString::GetStringRef(), lldb_private::FileSpec::IsCaseSensitive(), lldb_private::ConstString::IsEmpty(), lldb_private::FileSpec::IsRelative(), m_files, and UINT32_MAX.
Referenced by FindFileIndexes().
size_t FileSpecList::FindFileIndex | ( | size_t | idx, |
const FileSpec & | file, | ||
bool | full | ||
) | const |
Find a file index.
Find the index of the file in the file spec list that matches file starting idx entries into the file spec list.
[in] | idx | An index into the file list. |
[in] | file | The file specification to search for. |
[in] | full | Should FileSpec::Equal be called with "full" true or false. |
Definition at line 58 of file FileSpecList.cpp.
References lldb_private::FileSpec::Equal(), lldb_private::ConstString::Equals(), lldb_private::FileSpec::GetDirectory(), lldb_private::FileSpec::GetFilename(), lldb_private::FileSpec::IsCaseSensitive(), lldb_private::ConstString::IsEmpty(), m_files, and UINT32_MAX.
Referenced by lldb_private::SearchFilterByModuleListAndCU::AddressPasses(), lldb_private::SearchFilterByModuleListAndCU::CompUnitPasses(), CommandObjectSourceInfo::DumpFileLinesInCompUnit(), lldb::SBCompileUnit::FindSupportFileIndex(), lldb_private::SearchFilterByModuleList::ModulePasses(), lldb_private::SearchFilterByModuleList::Search(), lldb_private::SearchFilterByModuleListAndCU::Search(), and lldb_private::FileLineResolver::SearchCallback().
|
static |
Definition at line 166 of file FileSpecList.cpp.
const FileSpec & FileSpecList::GetFileSpecAtIndex | ( | size_t | idx | ) | const |
Get file at index.
Gets a file from the file list. If idx is not a valid index, an empty FileSpec object will be returned. The file objects that are returned can be tested using FileSpec::operator void*().
[in] | idx | An index into the file list. |
Definition at line 136 of file FileSpecList.cpp.
References m_files.
Referenced by lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), lldb_private::ClangModulesDeclVendor::Create(), CommandObjectTargetVariable::DoExecute(), CommandObjectThreadJump::DoExecute(), CommandObjectBreakpointSet::DoExecute(), CommandObjectSourceInfo::DumpFileLinesInCompUnit(), lldb_private::OptionValueFileSpecList::DumpValue(), lldb_private::PlatformDarwin::FindBundleBinaryInExecSearchPaths(), lldb_private::ThreadPlanStepInRange::FrameMatchesAvoidCriteria(), lldb_private::SearchFilterByModuleList::GetDescription(), lldb_private::SearchFilterByModuleListAndCU::GetDescription(), SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), SymbolFileDWARF::GetFile(), lldb_private::DebugMacroEntry::GetFileSpec(), lldb_private::ModuleList::GetSharedModule(), lldb_private::PlatformDarwin::GetSharedModule(), lldb::SBCompileUnit::GetSupportFileAtIndex(), lldb_private::Module::LoadScriptingResourceInTarget(), lldb_private::Symbols::LocateExecutableSymbolFile(), SymbolFileDWARF::ParseBlocksRecursive(), SymbolFileDWARF::ParseCompileUnit(), lldb_private::npdb::SymbolFileNativePDB::ParseInlineSite(), ObjectFileMachO::ParseSymtab(), lldb_private::Symbol::ResolveReExportedSymbolInModuleSpec(), lldb_private::SearchFilter::SerializeFileSpecList(), and lldb_private::Target::SetExecutableModule().
const FileSpec * FileSpecList::GetFileSpecPointerAtIndex | ( | size_t | idx | ) | const |
Get file specification pointer at index.
Gets a file from the file list. The file objects that are returned can be tested using FileSpec::operator void*().
[in] | idx | An index into the file list. |
Definition at line 143 of file FileSpecList.cpp.
References m_files.
Referenced by CommandObjectBreakpointSet::DoExecute().
size_t FileSpecList::GetSize | ( | ) | const |
Get the number of files in the file list.
Definition at line 164 of file FileSpecList.cpp.
References m_files.
Referenced by lldb_private::SearchFilterByModuleListAndCU::AddressPasses(), lldb_private::ClangModulesDeclVendor::Create(), lldb_private::Target::CreateScriptedBreakpoint(), lldb_private::TargetList::CreateTargetInternal(), CommandObjectTargetVariable::DoExecute(), CommandObjectThreadJump::DoExecute(), CommandObjectBreakpointSet::DoExecute(), lldb_private::OptionValueFileSpecList::DumpValue(), lldb_private::PlatformDarwin::FindBundleBinaryInExecSearchPaths(), lldb_private::ThreadPlanStepInRange::FrameMatchesAvoidCriteria(), ObjectFilePECOFF::GetDependentModules(), lldb_private::SearchFilterByModuleList::GetDescription(), lldb_private::SearchFilterByModuleListAndCU::GetDescription(), SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), GetModuleConfig(), lldb::SBCompileUnit::GetNumSupportFiles(), lldb_private::Target::GetSearchFilterForModuleAndCUList(), lldb_private::Target::GetSearchFilterForModuleList(), lldb_private::ModuleList::GetSharedModule(), lldb_private::PlatformDarwin::GetSharedModule(), lldb_private::CompileUnit::GetSupportFiles(), lldb_private::Module::LoadScriptingResourceInTarget(), lldb_private::Symbols::LocateExecutableSymbolFile(), lldb_private::SearchFilterByModuleList::ModulePasses(), SymbolFileDWARF::ParseCompileUnit(), ObjectFileMachO::ParseSymtab(), lldb_private::Symbol::ResolveReExportedSymbolInModuleSpec(), lldb_private::SearchFilterByModuleListAndCU::Search(), lldb_private::SearchFilter::SerializeFileSpecList(), lldb_private::Target::SetExecutableModule(), CommandObjectThreadJump::CommandOptions::SetOptionValue(), and lldb_private::OptionValueFileSpecList::SetValueFromString().
|
inline |
Definition at line 189 of file FileSpecList.h.
References m_files.
Referenced by lldb_private::OptionValueFileSpecList::SetValueFromString().
|
inline |
Definition at line 181 of file FileSpecList.h.
References m_files.
size_t FileSpecList::MemorySize | ( | ) | const |
Get the memory cost of this object.
Return the size in bytes that this object takes in memory. This returns the size in bytes of this object, not any shared string values it may refer to.
Definition at line 153 of file FileSpecList.cpp.
References end(), FileSpecList(), and m_files.
|
default |
Assignment operator.
Replace the file list in this object with the file list from rhs.
[in] | rhs | A file list object to copy. |
|
default |
Move-assignment operator.
|
inline |
Definition at line 208 of file FileSpecList.h.
References m_files.
Referenced by lldb_private::OptionValueFileSpecList::SetValueFromString().
|
inline |
Definition at line 200 of file FileSpecList.h.
References m_files.
Referenced by lldb_private::OptionValueFileSpecList::SetValueFromString().
|
protected |
A collection of FileSpec objects.
Definition at line 223 of file FileSpecList.h.
Referenced by Append(), AppendIfUnique(), begin(), Clear(), Dump(), EmplaceBack(), end(), FindCompatibleIndex(), FindFileIndex(), GetFileSpecAtIndex(), GetFileSpecPointerAtIndex(), GetSize(), Insert(), IsEmpty(), MemorySize(), Remove(), and Replace().