LLDB mainline
|
A file utility class. More...
#include "lldb/Utility/FileSpec.h"
Public Types | |
using | Style = llvm::sys::path::Style |
Public Member Functions | |
FileSpec () | |
FileSpec (llvm::StringRef path, Style style=Style::native) | |
Constructor with path. | |
FileSpec (llvm::StringRef path, const llvm::Triple &triple) | |
bool | DirectoryEquals (const FileSpec &other) const |
bool | FileEquals (const FileSpec &other) const |
bool | operator== (const FileSpec &rhs) const |
Equal to operator. | |
bool | operator!= (const FileSpec &rhs) const |
Not equal to operator. | |
bool | operator< (const FileSpec &rhs) const |
Less than to operator. | |
operator bool () const | |
Convert to pointer operator. | |
bool | operator! () const |
Logical NOT operator. | |
void | Clear () |
Clears the object state. | |
bool | IsCaseSensitive () const |
Case sensitivity of path. | |
void | Dump (llvm::raw_ostream &s) const |
Dump this object to a Stream. | |
Style | GetPathStyle () const |
const ConstString & | GetDirectory () const |
Directory string const get accessor. | |
void | SetDirectory (ConstString directory) |
Directory string set accessor. | |
void | SetDirectory (llvm::StringRef directory) |
void | ClearDirectory () |
Clear the directory in this object. | |
const ConstString & | GetFilename () const |
Filename string const get accessor. | |
void | SetFilename (ConstString filename) |
Filename string set accessor. | |
void | SetFilename (llvm::StringRef filename) |
void | ClearFilename () |
Clear the filename in this object. | |
bool | IsSourceImplementationFile () const |
Returns true if the filespec represents an implementation source file (files with a ".c", ".cpp", ".m", ".mm" (many more) extension). | |
bool | IsRelative () const |
Returns true if the filespec represents a relative path. | |
bool | IsAbsolute () const |
Returns true if the filespec represents an absolute path. | |
void | MakeAbsolute (const FileSpec &dir) |
Make the FileSpec absolute by treating it relative to dir. | |
void | SetPath (llvm::StringRef p) |
Temporary helper for FileSystem change. | |
size_t | GetPath (char *path, size_t max_path_length, bool denormalize=true) const |
Extract the full path to the file. | |
std::string | GetPath (bool denormalize=true) const |
Extract the full path to the file. | |
ConstString | GetPathAsConstString (bool denormalize=true) const |
Get the full path as a ConstString. | |
void | GetPath (llvm::SmallVectorImpl< char > &path, bool denormalize=true) const |
Extract the full path to the file. | |
llvm::StringRef | GetFileNameExtension () const |
Extract the extension of the file. | |
ConstString | GetFileNameStrippingExtension () const |
Return the filename without the extension part. | |
size_t | MemorySize () const |
Get the memory cost of this object. | |
void | SetFile (llvm::StringRef path, Style style) |
Change the file specified with a new path. | |
void | SetFile (llvm::StringRef path, const llvm::Triple &triple) |
Change the file specified with a new path. | |
FileSpec | CopyByAppendingPathComponent (llvm::StringRef component) const |
FileSpec | CopyByRemovingLastPathComponent () const |
void | PrependPathComponent (llvm::StringRef component) |
void | PrependPathComponent (const FileSpec &new_path) |
void | AppendPathComponent (llvm::StringRef component) |
void | AppendPathComponent (const FileSpec &new_path) |
bool | RemoveLastPathComponent () |
Removes the last path component by replacing the current path with its parent. | |
std::vector< llvm::StringRef > | GetComponents () const |
Gets the components of the FileSpec's path. | |
Static Public Member Functions | |
static int | Compare (const FileSpec &lhs, const FileSpec &rhs, bool full) |
Compare two FileSpec objects. | |
static bool | Equal (const FileSpec &a, const FileSpec &b, bool full) |
static bool | Match (const FileSpec &pattern, const FileSpec &file) |
Match FileSpec pattern against FileSpec file. | |
static std::optional< Style > | GuessPathStyle (llvm::StringRef absolute_path) |
Attempt to guess path style for a given path string. | |
Protected Types | |
enum class | Absolute : uint8_t { Calculate , Yes , No } |
Protected Member Functions | |
void | SetFile (llvm::StringRef path) |
void | PathWasModified () |
Called anytime m_directory or m_filename is changed to clear any cached state in this object. | |
Protected Attributes | |
ConstString | m_directory |
The unique'd directory path. | |
ConstString | m_filename |
The unique'd filename path. | |
Absolute | m_absolute = Absolute::Calculate |
Cache whether this path is absolute. | |
Style | m_style |
The syntax that this path uses. (e.g. Windows / Posix) | |
A file utility class.
A file specification class that divides paths up into a directory and basename. These string values of the paths are put into uniqued string pools for fast comparisons and efficient memory usage.
Another reason the paths are split into the directory and basename is to allow efficient debugger searching. Often in a debugger the user types in the basename of the file, for example setting a breakpoint by file and line, or specifying a module (shared library) to limit the scope in which to execute a command. The user rarely types in a full path. When the paths are already split up, it makes it easy for us to compare only the basenames of a lot of file specifications without having to split up the file path each time to get to the basename.
Definition at line 56 of file FileSpec.h.
using lldb_private::FileSpec::Style = llvm::sys::path::Style |
Definition at line 58 of file FileSpec.h.
|
strongprotected |
Enumerator | |
---|---|
Calculate | |
Yes | |
No |
Definition at line 416 of file FileSpec.h.
FileSpec::FileSpec | ( | ) |
Definition at line 68 of file FileSpec.cpp.
Referenced by CopyByRemovingLastPathComponent().
|
explicit |
Constructor with path.
Takes a path to a file which can be just a filename, or a full path. If path is not nullptr or empty, this function will call FileSpec::SetFile (const char *path).
[in] | path | The full or partial path to a file. |
[in] | style | The style of the path |
Definition at line 71 of file FileSpec.cpp.
References SetFile().
|
explicit |
Definition at line 75 of file FileSpec.cpp.
void FileSpec::AppendPathComponent | ( | const FileSpec & | new_path | ) |
Definition at line 454 of file FileSpec.cpp.
References AppendPathComponent(), and GetPath().
void FileSpec::AppendPathComponent | ( | llvm::StringRef | component | ) |
Definition at line 447 of file FileSpec.cpp.
References GetPath(), m_style, and SetFile().
Referenced by AppendPathComponent(), AppendPathComponents(), BuildCpusSection(), BuildModulesSection(), BuildThreadsSection(), lldb_private::HostInfoBase::ComputeGlobalTempFileDirectory(), lldb_private::HostInfoBase::ComputeProcessTempFileDirectory(), CopyByAppendingPathComponent(), lldb_private::TargetList::CreateTargetInternal(), lldb_private::PipePosix::CreateWithUniqueName(), lldb_private::PlatformDarwin::FindBundleBinaryInExecSearchPaths(), lldb_private::DataFileCache::GetCacheFilePath(), GetCommandLineToolsLibraryPath(), lldb_private::process_gdb_remote::GDBRemoteCommunication::GetDebugserverPath(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::GetDomainSocketPath(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), lldb_private::PlatformRemoteDarwinDevice::GetFileInSDK(), lldb_private::Platform::GetModuleCacheRoot(), lldb_private::PlatformDarwin::GetSDKDirectoryForModules(), lldb_private::PlatformDarwinDevice::GetSharedModuleWithLocalCache(), lldb_private::REPL::GetSourcePath(), lldb_private::Platform::Install(), lldb_private::Platform::LoadImage(), lldb_private::PlatformDarwin::LocateExecutable(), LookForDsymNextToExecutablePath(), lldb_private::HostInfoAndroid::ResolveLibraryPath(), SaveTraceBundleDescription(), lldb_private::CommandInterpreter::SaveTranscript(), lldb_private::CommandInterpreter::SourceInitFileGlobal(), lldb_private::plugin::dwarf::SymbolFileDWARF::UpdateExternalModuleListIfNeeded(), lldb_private::PlatformDarwinDevice::UpdateSDKDirectoryInfosIfNeeded(), WriteContextSwitchTrace(), and WriteIntelPTTrace().
void FileSpec::Clear | ( | ) |
Clears the object state.
Clear this object by releasing both the directory and filename string values and reverting them to empty strings.
Definition at line 259 of file FileSpec.cpp.
References lldb_private::ConstString::Clear(), m_directory, m_filename, and PathWasModified().
Referenced by lldb_private::Platform::CallLocateModuleCallbackIfSet(), lldb_private::Declaration::Clear(), lldb_private::FileLineResolver::Clear(), lldb_private::ModuleSpec::Clear(), lldb_private::FileAction::Clear(), lldb_private::ProcessLaunchInfo::Clear(), lldb_private::ProcessInfo::Clear(), DYLDRendezvous::SOEntry::clear(), lldb_private::OptionValueFileColonLine::Clear(), lldb_private::DynamicLoaderDarwin::ImageInfo::Clear(), lldb_private::HostInfoBase::ComputeGlobalTempFileDirectory(), PlatformPOSIX::DoLoadImage(), lldb_private::PlatformWindows::DoLoadImage(), lldb_private::Host::GetBundleDirectory(), lldb_private::process_gdb_remote::GDBRemoteCommunication::GetDebugserverPath(), lldb_private::Function::GetEndLineSourceInfo(), lldb_private::PlatformRemoteDarwinDevice::GetFileInSDK(), lldb_private::File::GetFileSpec(), lldb_private::NativeFile::GetFileSpec(), lldb_private::process_freebsd::NativeProcessFreeBSD::GetLoadedModuleFileSpec(), lldb_private::process_linux::NativeProcessLinux::GetLoadedModuleFileSpec(), lldb_private::process_netbsd::NativeProcessNetBSD::GetLoadedModuleFileSpec(), LocateDSYMInVincinityOfExecutable(), lldb_private::SymbolLocatorDebugSymbols::LocateExecutableObjectFile(), LocateMacOSXFilesUsingDebugSymbols(), CommandObjectDiagnosticsDump::CommandOptions::OptionParsingStarting(), CommandObjectLogEnable::CommandOptions::OptionParsingStarting(), CommandObjectLogDump::CommandOptions::OptionParsingStarting(), CommandObjectMemoryWrite::OptionGroupWriteMemory::OptionParsingStarting(), CommandObjectProcessLoad::CommandOptions::OptionParsingStarting(), CommandObjectSourceInfo::CommandOptions::OptionParsingStarting(), CommandObjectSourceList::CommandOptions::OptionParsingStarting(), CommandObjectTargetModulesLookup::CommandOptions::OptionParsingStarting(), lldb_private::ProcessInfo::SetExecutableFile(), SetFile(), CommandObjectMemoryWrite::OptionGroupWriteMemory::SetOptionValue(), and lldb_private::Platform::SetWorkingDirectory().
void FileSpec::ClearDirectory | ( | ) |
Clear the directory in this object.
Definition at line 360 of file FileSpec.cpp.
References lldb_private::ConstString::Clear(), m_directory, and PathWasModified().
Referenced by lldb_private::SymbolContext::FindBestGlobalDataSymbol(), lldb_private::ClangExpressionDeclMap::GetSymbolAddress(), ObjectFileMachO::ParseSymtab(), lldb_private::minidump::ProcessMinidump::ReadModuleList(), and lldb_private::Symbol::ResolveReExportedSymbolInModuleSpec().
void FileSpec::ClearFilename | ( | ) |
Clear the filename in this object.
Definition at line 355 of file FileSpec.cpp.
References lldb_private::ConstString::Clear(), m_filename, and PathWasModified().
Compare two FileSpec objects.
If full is true, then both the directory and the filename must match. If full is false, then the directory names for lhs and rhs are only compared if they are both not empty. This allows a FileSpec object to only contain a filename and it can match FileSpec objects that have matching filenames with different paths.
[in] | lhs | A const reference to the Left Hand Side object to compare. |
[in] | rhs | A const reference to the Right Hand Side object to compare. |
[in] | full | If true, then both the directory and filenames will have to match for a compare to return zero (equal to). If false and either directory from lhs or rhs is empty, then only the filename will be compared, else a full comparison is done. |
Definition at line 273 of file FileSpec.cpp.
References lldb_private::ConstString::Compare(), IsCaseSensitive(), m_directory, and m_filename.
Referenced by lldb_private::Declaration::Compare(), lldb_private::LineEntry::Compare(), lldb_private::Declaration::FileAndLineEqual(), operator<(), and lldb_private::FileLineResolver::SearchCallback().
FileSpec FileSpec::CopyByAppendingPathComponent | ( | llvm::StringRef | component | ) | const |
Definition at line 418 of file FileSpec.cpp.
References AppendPathComponent().
Referenced by lldb_private::HostInfoMacOSX::ComputeSupportExeDirectory(), lldb_private::Debugger::Debugger(), lldb_private::Diagnostics::DumpDiangosticsLog(), ObjectFileMachO::GetDependentModules(), lldb_private::platform_android::PlatformAndroid::GetFile(), ObjectFileELF::GetGnuDebugDataObjectFile(), lldb_private::IRExecutionUnit::GetRunnableInfo(), and lldb_private::platform_android::PlatformAndroid::PutFile().
FileSpec FileSpec::CopyByRemovingLastPathComponent | ( | ) | const |
Definition at line 424 of file FileSpec.cpp.
References FileSpec(), GetPath(), and m_style.
Referenced by ObjectFileMachO::GetDependentModules(), lldb_private::CommandInterpreter::HandleCommandsFromFile(), loadMatchingPDBFile(), and MakeCacheFolderForFile().
bool FileSpec::DirectoryEquals | ( | const FileSpec & | other | ) | const |
Definition at line 228 of file FileSpec.cpp.
References lldb_private::ConstString::Equals(), IsCaseSensitive(), and m_directory.
Referenced by operator==().
void FileSpec::Dump | ( | llvm::raw_ostream & | s | ) | const |
Dump this object to a Stream.
Dump the object to the supplied stream s. If the object contains a valid directory name, it will be displayed followed by a directory delimiter, and the filename.
[in] | s | The stream to which to dump the object description. |
Definition at line 325 of file FileSpec.cpp.
References GetPath(), m_filename, and m_style.
Referenced by lldb_private::ProcessInstanceInfo::Dump(), lldb_private::wasm::ObjectFileWasm::Dump(), DumpFullpath(), lldb_private::LineEntry::DumpStopContext(), lldb_private::OptionValueFileSpecList::DumpValue(), lldb_private::FormatEntity::FormatFileSpec(), lldb_private::Module::LoadScriptingResourceInTarget(), lldb_private::operator<<(), and UUIDsMatch().
Definition at line 294 of file FileSpec.cpp.
References FileEquals(), and GetDirectory().
Referenced by lldb_private::BreakpointResolverFileLine::DeduceSourceMapping(), FindFileIndex(), and IsCompatible().
bool FileSpec::FileEquals | ( | const FileSpec & | other | ) | const |
Definition at line 233 of file FileSpec.cpp.
References lldb_private::ConstString::Equals(), IsCaseSensitive(), and m_filename.
Referenced by Equal(), IsCompatible(), Match(), and operator==().
std::vector< llvm::StringRef > FileSpec::GetComponents | ( | ) | const |
Gets the components of the FileSpec's path.
For example, given the path: /System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation
This function returns: {"System", "Library", "PrivateFrameworks", "UIFoundation.framework", "UIFoundation"}
Definition at line 468 of file FileSpec.cpp.
References lldb_private::ConstString::GetStringRef(), lldb_private::ConstString::IsEmpty(), m_directory, m_filename, and m_style.
Referenced by lldb_private::PlatformDarwin::FindBundleBinaryInExecSearchPaths().
|
inline |
Directory string const get accessor.
Definition at line 223 of file FileSpec.h.
References m_directory.
Referenced by lldb_private::CppModuleConfiguration::analyzeFile(), BuildModulesSection(), lldb_private::SourceManager::File::CommonInitializer(), lldb_private::HostInfoBase::ComputePathRelativeToLibrary(), lldb_private::HostInfoBase::ComputeSharedLibraryDirectory(), lldb_private::HostInfoLinux::ComputeSupportExeDirectory(), lldb_private::HostInfoMacOSX::ComputeSupportExeDirectory(), lldb_private::TargetList::CreateTargetInternal(), lldb_private::BreakpointResolverFileLine::DeduceSourceMapping(), CommandObjectTargetCreate::DoExecute(), DumpDirectory(), DumpFile(), CommandObjectSourceInfo::DumpFileLinesInCompUnit(), Equal(), FindFileIndex(), GetChildFileSpecificationsFromThin(), ObjectFileMachO::GetDependentModules(), lldb_private::Target::GetOrCreateModule(), lldb_private::PlatformDarwinDevice::GetSharedModuleWithLocalCache(), lldb_private::Platform::Install(), IsCompatible(), lldb_private::Trace::LoadPostMortemTraceFromFile(), lldb_private::PlatformDarwin::LocateExecutableScriptingResources(), lldb_private::SymbolLocatorDefault::LocateExecutableSymbolFile(), Match(), CommandObjectSourceList::SourceInfo::operator<(), ObjectFilePECOFF::ParseDependentModules(), resolve_tilde(), lldb_private::FileSystem::ResolveExecutableLocation(), and lldb_private::FileLineResolver::SearchCallback().
|
inline |
Filename string const get accessor.
Definition at line 240 of file FileSpec.h.
References m_filename.
Referenced by CommandObjectTargetSymbolsAdd::AddModuleSymbols(), lldb_private::AppleObjCRuntime::AppleIsModuleObjCLibrary(), CanModuleBeGNUstepObjCLibrary(), lldb_private::SourceManager::File::CommonInitializer(), ObjectFilePECOFF::CreateBinary(), ObjectFileXCOFF::CreateBinary(), ObjectFileCOFF::CreateInstance(), lldb_private::SymbolLocatorDebugSymbols::DownloadObjectAndSymbolFile(), lldb_private::ProcessInstanceInfo::Dump(), lldb_private::Declaration::Dump(), lldb_private::Target::Dump(), DumpBasename(), DumpCompileUnitLineTable(), ObjectFileELF::DumpDependentModules(), DumpFile(), CommandObjectSourceInfo::DumpFileLinesInCompUnit(), CommandObjectSourceInfo::DumpLinesInSymbolContexts(), lldb_private::Section::DumpName(), lldb_private::Declaration::DumpStopContext(), lldb_private::LineEntry::DumpStopContext(), FindFileIndex(), lldb_private::FormatEntity::FormatFileSpec(), lldb_private::ModuleCache::Get(), lldb_private::Module::GetCacheKey(), GetCoffUUID(), lldb_private::PlatformRemoteDarwinDevice::GetConnectedSDKIndex(), lldb::SBProcess::GetDescription(), lldb_private::Module::GetDescription(), lldb_private::Address::GetDescription(), lldb_private::AddressResolverFileLine::GetDescription(), lldb_private::SearchFilterByModule::GetDescription(), lldb_private::SearchFilterByModuleList::GetDescription(), lldb_private::SearchFilterByModuleListAndCU::GetDescription(), lldb_private::BreakpointLocation::GetDescription(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwpSymbolFile(), lldb_private::Target::GetEntryPointAddress(), lldb_private::DWARFCallFrameInfo::GetFDEIndex(), GetFreeBSDProcessArgs(), lldb_private::ScriptedProcess::GetLoadedDynamicLibrariesInfos(), lldb_private::process_freebsd::NativeProcessFreeBSD::GetLoadedModuleFileSpec(), lldb_private::process_linux::NativeProcessLinux::GetLoadedModuleFileSpec(), lldb_private::process_netbsd::NativeProcessNetBSD::GetLoadedModuleFileSpec(), GetMacOSXProcessArgs(), lldb_private::Breakpoint::GetMatchingFileLine(), ObjectFileCOFF::GetModuleSpecifications(), ObjectFileELF::GetModuleSpecifications(), ObjectFilePECOFF::GetModuleSpecifications(), lldb_private::ProcessInfo::GetName(), lldb_private::ProcessInfo::GetNameAsStringRef(), GetNetBSDProcessArgs(), GetOpenBSDProcessArgs(), lldb_private::Target::GetOrCreateModule(), lldb_private::PlatformDarwin::GetSDKPathFromDebugInfo(), lldb_private::ModuleList::GetSharedModule(), lldb_private::PlatformDarwinDevice::GetSharedModuleWithLocalCache(), lldb_private::Args::GetShellSafeArgument(), lldb_private::SymbolFileOnDemand::GetSymbolFileName(), lldb_private::CommandInterpreter::HandleCommandsFromFile(), lldb_private::Platform::Install(), lldb_private::Thread::JumpToLine(), lldb_private::formatters::LibcxxFunctionSummaryProvider(), lldb_private::Platform::LoadImage(), lldb_private::Platform::LoadImageUsingPaths(), loadMatchingPDBFile(), LocateDSYMInVincinityOfExecutable(), lldb_private::SymbolLocatorDefault::LocateExecutableObjectFile(), lldb_private::PlatformDarwin::LocateExecutableScriptingResources(), lldb_private::SymbolLocatorDebugSymbols::LocateExecutableSymbolFile(), lldb_private::SymbolLocatorDefault::LocateExecutableSymbolFile(), LookForDsymNextToExecutablePath(), Match(), lldb_private::InstrumentationRuntime::ModulesDidLoad(), CommandObjectSourceList::SourceInfo::operator<(), ObjectFileELF::ParseSymtab(), ObjectFileMachO::ParseSymtab(), lldb_private::ModuleCache::Put(), lldb_private::Process::ReadModuleFromMemory(), RecurseCopy_Callback(), lldb_private::RegisterAssertFrameRecognizer(), RegisterObjCExceptionRecognizer(), lldb_private::Module::ReportWarningOptimization(), lldb_private::FileSystem::Resolve(), lldb_private::FileSystem::ResolveExecutableLocation(), lldb_private::XcodeSDK::SDKSupportsModules(), lldb_private::BreakpointResolverFileLine::SearchCallback(), and lldb_private::AddressResolverFileLine::SearchCallback().
llvm::StringRef FileSpec::GetFileNameExtension | ( | ) | const |
Extract the extension of the file.
Returns a ConstString that represents the extension of the filename for this FileSpec object. If this object does not represent a file, or the filename has no extension, ConstString(nullptr) is returned. The dot ('.') character is the first character in the returned string.
Definition at line 403 of file FileSpec.cpp.
References lldb_private::ConstString::GetStringRef(), m_filename, and m_style.
Referenced by IsSourceImplementationFile(), lldb_private::Lua::LoadModule(), LoadPluginCallback(), and ObjectFileELF::ParseSymbols().
ConstString FileSpec::GetFileNameStrippingExtension | ( | ) | const |
Return the filename without the extension part.
Returns a ConstString that represents the filename of this object without the extension part (e.g. for a file named "foo.bar", "foo" is returned)
Definition at line 407 of file FileSpec.cpp.
References lldb_private::ConstString::GetStringRef(), m_filename, and m_style.
Referenced by CommandObjectTargetSymbolsAdd::AddModuleSymbols(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwpSymbolFile(), lldb_private::Lua::LoadModule(), and lldb_private::PlatformDarwin::LocateExecutableScriptingResources().
std::string FileSpec::GetPath | ( | bool | denormalize = true | ) | const |
Extract the full path to the file.
Extract the directory and path into a std::string, which is returned.
Definition at line 377 of file FileSpec.cpp.
References GetPath().
size_t FileSpec::GetPath | ( | char * | path, |
size_t | max_path_length, | ||
bool | denormalize = true |
||
) | const |
Extract the full path to the file.
Extract the directory and path into a fixed buffer. This is needed as the directory and path are stored in separate string values.
[out] | path | The buffer in which to place the extracted full path. |
[in] | max_path_length | The maximum length of path. |
Definition at line 367 of file FileSpec.cpp.
References GetPath().
Referenced by lldb_private::PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(), CommandObjectTargetSymbolsAdd::AddModuleSymbols(), lldb_private::Block::AddRange(), lldb_private::CppModuleConfiguration::analyzeFile(), AppendPathComponent(), lldb_private::Process::Attach(), BuildCpusSection(), lldb_private::process_gdb_remote::ProcessGDBRemote::BuildDynamicRegisterInfo(), BuildModulesSection(), BuildThreadsSection(), SymbolFilePDB::CalculateAbilities(), lldb_private::Platform::CalculateMD5(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::CalculateMD5(), lldb_private::Platform::CallLocateModuleCallbackIfSet(), lldb_private::TargetProperties::CheckJITObjectsDir(), lldb_private::ComputeClangResourceDirectory(), lldb_private::HostInfoBase::ComputeGlobalTempFileDirectory(), lldb_private::HostInfoMacOSX::ComputeHeaderDirectory(), lldb_private::HostInfoPosix::ComputeHeaderDirectory(), lldb_private::HostInfoBase::ComputePathRelativeToLibrary(), lldb_private::HostInfoBase::ComputeProcessTempFileDirectory(), lldb_private::HostInfoMacOSX::ComputeSupportExeDirectory(), lldb_private::HostInfoLinux::ComputeSystemPluginsDirectory(), lldb_private::HostInfoMacOSX::ComputeSystemPluginsDirectory(), lldb_private::ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell(), CopyByRemovingLastPathComponent(), lldb_private::ClangModulesDeclVendor::Create(), ObjectFilePECOFF::CreateBinary(), ObjectFileXCOFF::CreateBinary(), lldb_private::Target::CreateBreakpointsFromFile(), lldb_private::FileSystem::CreateDataBuffer(), lldb_private::wasm::ObjectFileWasm::CreateInstance(), ObjectFileCOFF::CreateInstance(), SymbolVendorMacOSX::CreateInstance(), lldb_private::TypeSystemClang::CreateInstance(), ProcessFreeBSDKernel::CreateInstance(), ProcessMachCore::CreateInstance(), lldb_private::minidump::ProcessMinidump::CreateInstance(), ProcessElfCore::CreateInstance(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::CreateProcessInfoResponse(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::CreateSymlink(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::CreateSymlink(), lldb_private::TargetList::CreateTargetInternal(), lldb_private::PipePosix::CreateWithUniqueName(), lldb_private::FileSystem::CreateWritableDataBuffer(), lldb_private::Debugger::Debugger(), lldb_private::DebuggerThread::DebuggerThreadLaunchRoutine(), lldb_private::DebuggerThread::DebugLaunch(), lldb_private::PlatformQemuUser::DebugProcess(), DefaultComputeClangResourceDirectory(), lldb_private::FileSystem::DirBegin(), CommandObjectLogEnable::DoExecute(), CommandObjectLogDump::DoExecute(), CommandObjectPlatformProcessLaunch::DoExecute(), CommandObjectSettingsWrite::DoExecute(), CommandObjectTargetVariable::DoExecute(), CommandObjectTargetModulesAdd::DoExecute(), CommandObjectTargetModulesLoad::DoExecute(), CommandObjectTargetSymbolsAdd::DoExecute(), CommandObjectMemoryRead::DoExecute(), CommandObjectMemoryWrite::DoExecute(), CommandObjectTargetCreate::DoExecute(), PlatformPOSIX::DoLoadImage(), lldb_private::PlatformWindows::DoLoadImage(), lldb_private::Platform::DownloadModuleSlice(), lldb_private::platform_android::PlatformAndroid::DownloadModuleSlice(), lldb_private::SymbolLocatorDebugSymbols::DownloadObjectAndSymbolFile(), Dump(), lldb_private::Diagnostics::Dump(), lldb_private::FileAction::Dump(), lldb_private::Module::Dump(), lldb_private::Symtab::Dump(), lldb_private::Diagnostics::DumpDiangosticsLog(), DumpFullpath(), DumpTargetInfo(), lldb_private::OptionValueFileColonLine::DumpValue(), lldb_private::OptionValueFileSpec::DumpValue(), lldb_private::FileSystem::Exists(), lldb_private::PlatformDarwin::FindBundleBinaryInExecSearchPaths(), lldb_private::PathMappingList::FindFile(), lldb_private::DynamicLoader::FindModuleViaTarget(), lldb_private::ObjectFile::FindPlugin(), lldb_private::PlatformDarwin::FindSDKInXcodeForModules(), lldb_private::SymbolLocatorDebugSymbols::FindSymbolFileInBundle(), lldb_private::DynamicLoaderDarwin::FindTargetModuleForImageInfo(), lldb_private::Function::GetBlock(), lldb_private::FileSystem::GetByteSize(), lldb_private::GetClangResourceDir(), lldb_private::process_gdb_remote::GDBRemoteCommunication::GetDebugserverPath(), lldb_private::Module::GetDescription(), lldb_private::BreakpointResolverFileLine::GetDescription(), lldb_private::FileLineResolver::GetDescription(), lldb_private::PlatformDarwinDevice::GetDeviceSupportDirectoryForOSVersion(), CommandObjectDiagnosticsDump::GetDirectory(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::GetDomainSocketPath(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), GetEnvDeveloperDir(), lldb_private::platform_android::PlatformAndroid::GetFile(), PlatformPOSIX::GetFile(), lldb_private::OptionValueFileSpec::GetFileContents(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetFileExists(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetFileLoadAddress(), lldb_private::NativeProcessWindows::GetFileLoadAddress(), lldb_private::Platform::GetFilePermissions(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetFilePermissions(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::GetFilePermissions(), lldb_private::Platform::GetFileSize(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetFileSize(), lldb_private::NativeProcessWindows::GetLoadedModuleFileSpec(), lldb_private::InstrumentationRuntimeTSan::GetLocationDescription(), lldb_private::FileSystem::GetModificationTime(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetModuleInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::GetModuleInfo(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::GetModuleSpec(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetModuleSpec(), lldb_private::ObjectFilePDB::GetModuleSpecifications(), lldb_private::ObjectFile::GetModuleSpecifications(), ObjectFileELF::GetModuleSpecifications(), GetModuleSpecInfoFromUUIDDictionary(), lldb_private::Target::GetOrCreateModule(), lldb_private::SymbolContext::GetParentOfInlinedScope(), GetPath(), GetPathAsConstString(), lldb_private::FileSystem::GetPermissions(), GetRelativePath(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::GetRemoteWorkingDirectory(), lldb_private::platform_linux::PlatformLinux::GetResumeCountForLaunchInfo(), lldb_private::PlatformDarwin::GetResumeCountForLaunchInfo(), lldb_private::platform_netbsd::PlatformNetBSD::GetResumeCountForLaunchInfo(), lldb_private::IRExecutionUnit::GetRunnableInfo(), lldb_private::PlatformMacOSX::GetSDKDirectory(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetSeparateDebugInfo(), lldb_private::ModuleList::GetSharedModule(), lldb_private::PlatformDarwin::GetSharedModule(), lldb_private::PlatformRemoteDarwinDevice::GetSharedModule(), lldb_private::PlatformDarwinDevice::GetSharedModuleWithLocalCache(), lldb_private::REPL::GetSourcePath(), lldb_private::FileSystem::GetStatus(), lldb_private::PlatformRemoteDarwinDevice::GetStatus(), lldb_private::PlatformAppleSimulator::GetSymbolFile(), lldb_private::PlatformRemoteDarwinDevice::GetSymbolFile(), lldb_private::Value::GetValueAsData(), lldb_private::HostInfoMacOSX::GetXcodeContentsDirectory(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_jModulesInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qModuleInfo(), lldb_private::CommandInterpreter::HandleCommandsFromFile(), HandleFileAction(), lldb_private::Module::Hash(), HexagonDYLDRendezvous::HexagonDYLDRendezvous(), lldb_private::ObjectFilePDB::initPDBFile(), lldb_private::Platform::Install(), lldb::SBPlatform::Install(), lldb_private::platform_android::AdbClient::SyncService::internalPullFile(), lldb_private::platform_android::AdbClient::SyncService::internalPushFile(), lldb_private::platform_android::AdbClient::SyncService::internalStat(), IsAbsolute(), lldb_private::FileSystem::IsDirectory(), lldb_private::FileSystem::IsLocal(), lldb_private::Target::Launch(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::LaunchGDBServer(), lldb_private::ProcessLauncherWindows::LaunchProcess(), lldb_private::Platform::LaunchProcess(), lldb_private::ProcessDebugger::LaunchProcess(), LaunchProcessPosixSpawn(), LoadPluginCallback(), lldb_private::Trace::LoadPostMortemTraceFromFile(), lldb_private::Module::LoadScriptingResourceInTarget(), LocateDSYMInVincinityOfExecutable(), lldb_private::SymbolLocatorDebugSymbols::LocateExecutableObjectFile(), lldb_private::PlatformDarwin::LocateExecutableScriptingResources(), lldb_private::SymbolLocatorDefault::LocateExecutableSymbolFile(), LocateMacOSXFilesUsingDebugSymbols(), lldb_private::ModuleList::LogUUIDAndPaths(), lldb_private::FileSystem::MakeAbsolute(), MakeAbsoluteAndRemap(), MakeCacheFolderForFile(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::MakeDirectory(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::MakeDirectory(), lldb_private::Platform::MakeDirectory(), lldb_private::ObjectFile::MapFileData(), ObjectFileELF::MapFileDataWritable(), ObjectFileXCOFF::MapFileDataWritable(), lldb_private::Module::Module(), lldb_private::trace_intel_pt::TraceIntelPTBundleLoader::NormalizeAllPaths(), lldb_private::ObjectFile::ObjectFile(), lldb_private::Trace::OnDataFileRead(), lldb_private::FileSystem::Open(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::OpenFile(), ObjectFilePECOFF::ParseDependentModules(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseImportedModules(), lldb_private::StructuredData::ParseJSONFromFile(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseSupportFiles(), PrependPathComponent(), lldb_private::ModuleCache::Put(), lldb::SBPlatform::Put(), lldb_private::Platform::PutFile(), lldb_private::platform_android::PlatformAndroid::PutFile(), PlatformPOSIX::PutFile(), lldb_private::FileSystem::Readable(), lldb_private::FileSystem::Readlink(), lldb_private::Process::ReadModuleFromMemory(), RecurseCopy_Callback(), lldb_private::FileSystem::RemoveFile(), RemoveLastPathComponent(), lldb_private::DebuggerStats::ReportStatistics(), lldb_private::FileSystem::Resolve(), lldb_private::RemoteAwarePlatform::ResolveExecutable(), DynamicLoaderPOSIXDYLD::ResolveExecutableModule(), lldb_private::ZipFileResolver::ResolveSharedLibraryPath(), lldb_private::Module::ResolveSymbolContextsForFileSpec(), lldb_private::FileSystem::ResolveSymbolicLink(), lldb_private::RealpathPrefixes::ResolveSymlinks(), lldb_private::PathMappingList::ReverseRemapPath(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::RunShellCommand(), lldb_private::Host::RunShellCommand(), ObjectFileMachO::SaveCore(), lldb_private::trace_intel_pt::TraceIntelPTBundleSaver::SaveToDisk(), SaveTraceBundleDescription(), lldb_private::CommandInterpreter::SaveTranscript(), lldb_private::Target::SerializeBreakpointsToFile(), lldb_private::SearchFilter::SerializeFileSpecList(), lldb_private::BreakpointResolverAddress::SerializeToStructuredData(), lldb_private::BreakpointResolverFileLine::SerializeToStructuredData(), lldb_private::SearchFilterByModule::SerializeToStructuredData(), lldb_private::ProcessInfo::SetExecutableFile(), lldb_private::Platform::SetFilePermissions(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetFilePermissions(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::SetFilePermissions(), ObjectFileMachO::SetLoadAddress(), CommandObjectSourceList::CommandOptions::SetOptionValue(), lldb_private::Symbol::SetReExportedSymbolSharedLibrary(), lldb_private::Platform::SetRemoteWorkingDirectory(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::SetRemoteWorkingDirectory(), lldb_private::SectionLoadList::SetSectionUnloaded(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetSTDERR(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetSTDIN(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetSTDOUT(), lldb_private::Module::SetSymbolFileFileSpec(), SetupModuleHeaderPaths(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetWorkingDir(), lldb_private::Platform::SetWorkingDirectory(), lldb_private::platform_android::AdbClient::ShellToFile(), lldb_private::process_gdb_remote::GDBRemoteCommunication::StartDebugserverProcess(), lldb::SBThread::StepOverUntil(), lldb_private::FileSystem::Symlink(), lldb_private::OptionValueFileSpec::ToJSON(), lldb_private::Platform::Unlink(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::Unlink(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::Unlink(), lldb_private::DynamicLoaderDarwin::UnloadModuleSections(), DYLDRendezvous::UpdateExecutablePath(), lldb_private::plugin::dwarf::SymbolFileDWARF::UpdateExternalModuleListIfNeeded(), lldb_private::PlatformDarwinDevice::UpdateSDKDirectoryInfosIfNeeded(), lldb_private::ModuleListProperties::UpdateSymlinkMappings(), WriteBytesToDisk(), and lldb_private::Module::~Module().
void FileSpec::GetPath | ( | llvm::SmallVectorImpl< char > & | path, |
bool | denormalize = true |
||
) | const |
Extract the full path to the file.
Extract the directory and path into an llvm::SmallVectorImpl<>
Definition at line 387 of file FileSpec.cpp.
References lldb_private::ConstString::GetStringRef(), m_directory, m_filename, and m_style.
ConstString FileSpec::GetPathAsConstString | ( | bool | denormalize = true | ) | const |
Get the full path as a ConstString.
This method should only be used when you need a ConstString or the const char * from a ConstString to ensure permanent lifetime of C string. Anyone needing the path temporarily should use the GetPath() method that returns a std:string.
Definition at line 383 of file FileSpec.cpp.
References GetPath().
Referenced by lldb_private::HostInfoBase::ComputeGlobalTempFileDirectory(), lldb_private::HostInfoBase::ComputeProcessTempFileDirectory(), lldb_private::HostInfoMacOSX::ComputeUserPluginsDirectory(), lldb_private::platform_android::PlatformAndroid::GetFile(), lldb_private::FileAction::GetPath(), lldb_private::Platform::Install(), lldb_private::PlatformDarwin::LocateExecutable(), and RecurseCopy_Callback().
FileSpec::Style FileSpec::GetPathStyle | ( | ) | const |
Definition at line 333 of file FileSpec.cpp.
References m_style.
Referenced by lldb_private::Platform::LoadImageUsingPaths(), lldb_private::FileSystem::MakeAbsolute(), and lldb_private::RealpathPrefixes::ResolveSymlinks().
|
static |
Attempt to guess path style for a given path string.
It returns a style, if it was able to make a reasonable guess, or std::nullopt if it wasn't. The guess will be correct if the input path was a valid absolute path on the system which produced it. On other paths the result of this function is unreliable (e.g. "c:\foo.txt" is a valid relative posix path).
Definition at line 310 of file FileSpec.cpp.
Referenced by lldb_private::plugin::dwarf::DWARFUnit::ComputeCompDirAndGuessPathStyle(), lldb_private::breakpad::SymbolFileBreakpad::ParseFileRecords(), lldb_private::PathMappingList::RemapPath(), and lldb_private::PathMappingList::ReverseRemapPath().
bool FileSpec::IsAbsolute | ( | ) | const |
Returns true if the filespec represents an absolute path.
Definition at line 511 of file FileSpec.cpp.
References Calculate, GetPath(), m_absolute, m_style, No, and Yes.
Referenced by lldb_private::HostInfoLinux::ComputeSupportExeDirectory(), IsRelative(), lldb_private::Platform::LoadImageUsingPaths(), and lldb_private::SymbolLocatorDefault::LocateExecutableSymbolFile().
|
inline |
Case sensitivity of path.
Definition at line 205 of file FileSpec.h.
References m_style.
Referenced by Compare(), lldb_private::BreakpointResolverFileLine::DeduceSourceMapping(), DirectoryEquals(), FileEquals(), FindFileIndex(), IsCompatible(), and lldb_private::RealpathPrefixes::ResolveSymlinks().
bool FileSpec::IsRelative | ( | ) | const |
Returns true if the filespec represents a relative path.
Definition at line 507 of file FileSpec.cpp.
References IsAbsolute().
Referenced by lldb_private::ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell(), lldb_private::TargetList::CreateTargetInternal(), lldb_private::BreakpointResolverFileLine::DeduceSourceMapping(), CommandObjectCommandsSource::DoExecute(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), lldb_private::platform_android::PlatformAndroid::GetFile(), IsCompatible(), MakeAbsolute(), lldb_private::trace_intel_pt::TraceIntelPTBundleLoader::NormalizePath(), lldb_private::platform_android::PlatformAndroid::PutFile(), lldb_private::PathMappingList::RemapPath(), and lldb_private::plugin::dwarf::SymbolFileDWARF::UpdateExternalModuleListIfNeeded().
bool FileSpec::IsSourceImplementationFile | ( | ) | const |
Returns true if the filespec represents an implementation source file (files with a ".c", ".cpp", ".m", ".mm" (many more) extension).
Definition at line 494 of file FileSpec.cpp.
References lldb_private::RegularExpression::Execute(), and GetFileNameExtension().
Referenced by lldb_private::Target::CreateBreakpoint().
void FileSpec::MakeAbsolute | ( | const FileSpec & | dir | ) |
Make the FileSpec absolute by treating it relative to dir.
Absolute FileSpecs are never changed by this function.
Definition at line 530 of file FileSpec.cpp.
References IsRelative(), and PrependPathComponent().
Referenced by CommandObjectCommandsSource::DoExecute(), MakeAbsoluteAndRemap(), and lldb_private::CommandInterpreter::SourceInitFileGlobal().
Match FileSpec pattern against FileSpec file.
If pattern has a directory component, then the file must have the same directory component. Otherwise, just it matches just the filename. An empty pattern matches everything.
Definition at line 301 of file FileSpec.cpp.
References FileEquals(), GetDirectory(), and GetFilename().
Referenced by CommandObjectSourceInfo::DumpLinesInSymbolContexts(), lldb_private::Module::FindCompileUnits(), lldb_private::ThreadPlanStepInRange::FrameMatchesAvoidCriteria(), lldb_private::ModuleSpec::Matches(), lldb_private::Module::MatchesModuleSpec(), lldb_private::SearchFilterByModule::ModulePasses(), lldb_private::npdb::SymbolFileNativePDB::ResolveSymbolContext(), lldb_private::CompileUnit::ResolveSymbolContext(), lldb_private::SearchFilterByModule::Search(), and lldb_private::SymbolContextSpecifier::SymbolContextMatches().
size_t FileSpec::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 413 of file FileSpec.cpp.
References m_directory, m_filename, and lldb_private::ConstString::MemorySize().
|
explicit |
Convert to pointer operator.
This allows code to check a FileSpec object to see if it contains anything valid using code such as:
Definition at line 219 of file FileSpec.cpp.
bool FileSpec::operator! | ( | ) | const |
Logical NOT operator.
This allows code to check a FileSpec object to see if it is invalid using code such as:
Definition at line 226 of file FileSpec.cpp.
References m_directory, and m_filename.
bool FileSpec::operator!= | ( | const FileSpec & | rhs | ) | const |
Not equal to operator.
Tests if this object is not equal to rhs.
[in] | rhs | A const FileSpec object reference to compare this object to. |
Definition at line 244 of file FileSpec.cpp.
bool FileSpec::operator< | ( | const FileSpec & | rhs | ) | const |
Less than to operator.
Tests if this object is less than rhs.
[in] | rhs | A const FileSpec object reference to compare this object to. |
Definition at line 247 of file FileSpec.cpp.
References Compare().
bool FileSpec::operator== | ( | const FileSpec & | rhs | ) | const |
Equal to operator.
Tests if this object is equal to rhs.
[in] | rhs | A const FileSpec object reference to compare this object to. |
Definition at line 239 of file FileSpec.cpp.
References DirectoryEquals(), and FileEquals().
|
inlineprotected |
Called anytime m_directory or m_filename is changed to clear any cached state in this object.
Definition at line 414 of file FileSpec.h.
References Calculate, and m_absolute.
Referenced by Clear(), ClearDirectory(), ClearFilename(), SetDirectory(), and SetFilename().
void FileSpec::PrependPathComponent | ( | const FileSpec & | new_path | ) |
Definition at line 443 of file FileSpec.cpp.
References GetPath(), and PrependPathComponent().
void FileSpec::PrependPathComponent | ( | llvm::StringRef | component | ) |
Definition at line 433 of file FileSpec.cpp.
References GetPath(), m_style, and SetFile().
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), lldb_private::Platform::GetSharedModule(), lldb_private::SymbolLocatorDefault::LocateExecutableSymbolFile(), MakeAbsolute(), lldb_private::trace_intel_pt::TraceIntelPTBundleLoader::NormalizePath(), and PrependPathComponent().
bool FileSpec::RemoveLastPathComponent | ( | ) |
Removes the last path component by replacing the current path with its parent.
When the current path has no parent, this is a no-op.
Definition at line 458 of file FileSpec.cpp.
References GetPath(), m_style, and SetFile().
Referenced by SymbolVendorMacOSX::CreateInstance(), GetModuleSpecInfoFromUUIDDictionary(), LocateDSYMInVincinityOfExecutable(), and LookForDsymNextToExecutablePath().
void FileSpec::SetDirectory | ( | ConstString | directory | ) |
Directory string set accessor.
[in] | directory | The value to replace the directory with. |
Definition at line 335 of file FileSpec.cpp.
References m_directory, and PathWasModified().
Referenced by lldb_private::ComputeClangResourceDirectory(), lldb_private::HostInfoBase::ComputeGlobalTempFileDirectory(), lldb_private::HostInfoMacOSX::ComputeHeaderDirectory(), lldb_private::HostInfoPosix::ComputeHeaderDirectory(), lldb_private::HostInfoBase::ComputePathRelativeToLibrary(), lldb_private::HostInfoBase::ComputeProcessTempFileDirectory(), lldb_private::HostInfoBase::ComputeSharedLibraryDirectory(), lldb_private::HostInfoLinux::ComputeSupportExeDirectory(), lldb_private::HostInfoMacOSX::ComputeSupportExeDirectory(), lldb_private::HostInfoLinux::ComputeSystemPluginsDirectory(), lldb_private::HostInfoMacOSX::ComputeSystemPluginsDirectory(), lldb_private::HostInfoLinux::ComputeUserPluginsDirectory(), lldb_private::HostInfoMacOSX::ComputeUserPluginsDirectory(), lldb_private::TargetList::CreateTargetInternal(), DefaultComputeClangResourceDirectory(), CommandObjectTargetCreate::DoExecute(), lldb_private::Target::GetOrCreateModule(), lldb_private::Platform::Install(), lldb_private::PlatformDarwin::LocateExecutable(), ObjectFilePECOFF::ParseDependentModules(), RecurseCopy_Callback(), lldb_private::FileSystem::Resolve(), and CommandObjectDiagnosticsDump::CommandOptions::SetOptionValue().
void FileSpec::SetDirectory | ( | llvm::StringRef | directory | ) |
Definition at line 340 of file FileSpec.cpp.
References m_directory, and PathWasModified().
|
protected |
Definition at line 169 of file FileSpec.cpp.
void FileSpec::SetFile | ( | llvm::StringRef | path, |
const llvm::Triple & | triple | ||
) |
Change the file specified with a new path.
Update the contents of this object with a new path. The path will be split up into a directory and filename and stored as uniqued string values for quick comparison and efficient memory usage.
[in] | path | A full, partial, or relative path to a file. |
[in] | triple | The triple which is used to set the Path style. |
Definition at line 210 of file FileSpec.cpp.
References SetFile().
void FileSpec::SetFile | ( | llvm::StringRef | path, |
Style | style | ||
) |
Change the file specified with a new path.
Update the contents of this object with a new path. The path will be split up into a directory and filename and stored as uniqued string values for quick comparison and efficient memory usage.
[in] | path | A full, partial, or relative path to a file. |
[in] | style | The style for the given path. |
Definition at line 174 of file FileSpec.cpp.
References Clear(), m_directory, m_filename, m_style, and lldb_private::ConstString::SetString().
Referenced by lldb::SBTarget::AddModule(), AppendPathComponent(), lldb::SBTarget::AttachToProcessWithName(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::AttachWaitProcess(), lldb_private::BreakpointResolverAddress::CreateFromStructuredData(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::DecodeProcessInfoResponse(), CommandObjectTargetSymbolsAdd::DoExecute(), CommandObjectTargetCreate::DoExecute(), ProcessElfCore::DoLoadCore(), PlatformPOSIX::DoLoadImage(), lldb_private::PlatformWindows::DoLoadImage(), FileSpec(), DYLDRendezvous::FillSOEntryFromModuleInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunication::GetDebugserverPath(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), GetExePathAndArch(), lldb_private::PlatformRemoteDarwinDevice::GetFileInSDK(), lldb_private::NativeFile::GetFileSpec(), GetFreeBSDProcessArgs(), GetMacOSXProcessArgs(), lldb_private::Host::GetModuleFileSpecForHostAddress(), GetModuleSpecInfoFromUUIDDictionary(), GetNetBSDProcessArgs(), GetOpenBSDProcessArgs(), lldb_private::HostInfoFreeBSD::GetProgramFileSpec(), lldb_private::HostInfoLinux::GetProgramFileSpec(), lldb_private::HostInfoMacOSX::GetProgramFileSpec(), lldb_private::HostInfoNetBSD::GetProgramFileSpec(), lldb_private::HostInfoWindows::GetProgramFileSpec(), lldb_private::PlatformAppleSimulator::GetSymbolFile(), lldb_private::PlatformRemoteDarwinDevice::GetSymbolFile(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetWorkingDir(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_A(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qfProcessInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vRun(), MakeAbsoluteAndRemap(), DynamicLoaderMacOSXDYLD::ParseLoadCommands(), ObjectFileMachO::ParseSymtab(), PrependPathComponent(), lldb_private::ProcessInstanceInfoMatch::ProcessInstanceInfoMatch(), lldb_private::FileSystem::Readlink(), DYLDRendezvous::ReadSOEntryFromMemory(), RemoveLastPathComponent(), lldb_private::RemoteAwarePlatform::ResolveExecutable(), lldb_private::PathMappingList::ReverseRemapPath(), lldb_private::ProcessInfo::SetArguments(), SetFile(), CommandObjectLogEnable::CommandOptions::SetOptionValue(), CommandObjectLogDump::CommandOptions::SetOptionValue(), CommandObjectPlatformProcessList::CommandOptions::SetOptionValue(), CommandObjectProcessLoad::CommandOptions::SetOptionValue(), CommandObjectTargetModulesLookup::CommandOptions::SetOptionValue(), lldb_private::CommandOptionsProcessAttach::SetOptionValue(), CommandObjectMemoryWrite::OptionGroupWriteMemory::SetOptionValue(), SetPath(), lldb_private::OptionValueFileColonLine::SetValueFromString(), lldb_private::OptionValueFileSpec::SetValueFromString(), lldb_private::ObjectFile::SplitArchivePathWithObject(), lldb_private::plugin::dwarf::SymbolFileDWARF::UpdateExternalModuleListIfNeeded(), and DYLDRendezvous::UpdateFileSpecIfNecessary().
void FileSpec::SetFilename | ( | ConstString | filename | ) |
Filename string set accessor.
[in] | filename | The const string to replace the directory with. |
Definition at line 345 of file FileSpec.cpp.
References m_filename, and PathWasModified().
Referenced by CommandObjectTargetSymbolsAdd::AddModuleSymbols(), lldb_private::Target::Attach(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwpSymbolFile(), lldb_private::Target::GetOrCreateModule(), lldb_private::DynamicLoaderDarwin::GetPThreadLibraryModule(), lldb_private::REPL::GetSourcePath(), lldb_private::Platform::Install(), lldb_private::ClangUtilityFunction::Install(), lldb_private::PlatformDarwin::LocateExecutable(), lldb_private::PlatformDarwin::LocateExecutableScriptingResources(), lldb_private::ClangUserExpression::Parse(), RecurseCopy_Callback(), and lldb_private::FunctionCaller::WriteFunctionWrapper().
void FileSpec::SetFilename | ( | llvm::StringRef | filename | ) |
Definition at line 350 of file FileSpec.cpp.
References m_filename, and PathWasModified().
|
inline |
Temporary helper for FileSystem change.
Definition at line 279 of file FileSpec.h.
References SetFile().
Referenced by lldb_private::DataFileCache::DataFileCache(), lldb_private::PlatformQemuUser::DebugProcess(), lldb_private::FileSystem::GetHomeDirectory(), lldb_private::ScriptedProcess::GetLoadedDynamicLibrariesInfos(), lldb_private::Target::GetOrCreateModule(), lldb_private::FileSystem::Resolve(), and lldb_private::Host::RunShellCommand().
|
mutableprotected |
Cache whether this path is absolute.
Definition at line 429 of file FileSpec.h.
Referenced by IsAbsolute(), and PathWasModified().
|
protected |
The unique'd directory path.
Definition at line 423 of file FileSpec.h.
Referenced by Clear(), ClearDirectory(), Compare(), DirectoryEquals(), GetComponents(), GetDirectory(), GetPath(), MemorySize(), operator!(), SetDirectory(), and SetFile().
|
protected |
The unique'd filename path.
Definition at line 426 of file FileSpec.h.
Referenced by Clear(), ClearFilename(), Compare(), Dump(), FileEquals(), GetComponents(), GetFilename(), GetFileNameExtension(), GetFileNameStrippingExtension(), GetPath(), MemorySize(), operator!(), SetFile(), and SetFilename().
|
protected |
The syntax that this path uses. (e.g. Windows / Posix)
Definition at line 432 of file FileSpec.h.
Referenced by AppendPathComponent(), CopyByRemovingLastPathComponent(), Dump(), GetComponents(), GetFileNameExtension(), GetFileNameStrippingExtension(), GetPath(), GetPathStyle(), IsAbsolute(), IsCaseSensitive(), PrependPathComponent(), RemoveLastPathComponent(), and SetFile().