LLDB mainline
|
#include <FileSystem.h>
Public Types | |
enum | EnumerateDirectoryResult { eEnumerateDirectoryResultNext , eEnumerateDirectoryResultEnter , eEnumerateDirectoryResultQuit } |
typedef EnumerateDirectoryResult(* | EnumerateDirectoryCallbackType) (void *baton, llvm::sys::fs::file_type file_type, llvm::StringRef) |
typedef std::function< EnumerateDirectoryResult(llvm::sys::fs::file_type file_type, llvm::StringRef)> | DirectoryCallback |
Public Member Functions | |
FileSystem () | |
FileSystem (llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > fs) | |
FileSystem (std::unique_ptr< TildeExpressionResolver > tilde_resolver) | |
FileSystem (const FileSystem &fs)=delete | |
FileSystem & | operator= (const FileSystem &fs)=delete |
Status | Symlink (const FileSpec &src, const FileSpec &dst) |
Status | Readlink (const FileSpec &src, FileSpec &dst) |
Status | ResolveSymbolicLink (const FileSpec &src, FileSpec &dst) |
FILE * | Fopen (const char *path, const char *mode) |
Wraps ::fopen in a platform-independent way. | |
int | Open (const char *path, int flags, int mode=0600) |
Wraps ::open in a platform-independent way. | |
llvm::Expected< std::unique_ptr< File > > | Open (const FileSpec &file_spec, File::OpenOptions options, uint32_t permissions=lldb::eFilePermissionsFileDefault, bool should_close_fd=true) |
bool | ResolveExecutableLocation (FileSpec &file_spec) |
Call into the Host to see if it can help find the file. | |
bool | GetHomeDirectory (llvm::SmallVectorImpl< char > &path) const |
Get the user home directory. | |
bool | GetHomeDirectory (FileSpec &file_spec) const |
void | EnumerateDirectory (llvm::Twine path, bool find_directories, bool find_files, bool find_other, EnumerateDirectoryCallbackType callback, void *callback_baton) |
std::error_code | GetRealPath (const llvm::Twine &path, llvm::SmallVectorImpl< char > &output) const |
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | GetVirtualFileSystem () |
void | SetHomeDirectory (std::string home_directory) |
llvm::vfs::directory_iterator | DirBegin (const FileSpec &file_spec, std::error_code &ec) |
Get a directory iterator. | |
llvm::vfs::directory_iterator | DirBegin (const llvm::Twine &dir, std::error_code &ec) |
llvm::ErrorOr< llvm::vfs::Status > | GetStatus (const FileSpec &file_spec) const |
Returns the Status object for the given file. | |
llvm::ErrorOr< llvm::vfs::Status > | GetStatus (const llvm::Twine &path) const |
llvm::sys::TimePoint | GetModificationTime (const FileSpec &file_spec) const |
Returns the modification time of the given file. | |
llvm::sys::TimePoint | GetModificationTime (const llvm::Twine &path) const |
uint64_t | GetByteSize (const FileSpec &file_spec) const |
Returns the on-disk size of the given file in bytes. | |
uint64_t | GetByteSize (const llvm::Twine &path) const |
uint32_t | GetPermissions (const FileSpec &file_spec) const |
Return the current permissions of the given file. | |
uint32_t | GetPermissions (const llvm::Twine &path) const |
uint32_t | GetPermissions (const FileSpec &file_spec, std::error_code &ec) const |
uint32_t | GetPermissions (const llvm::Twine &path, std::error_code &ec) const |
bool | Exists (const FileSpec &file_spec) const |
Returns whether the given file exists. | |
bool | Exists (const llvm::Twine &path) const |
bool | Readable (const FileSpec &file_spec) const |
Returns whether the given file is readable. | |
bool | Readable (const llvm::Twine &path) const |
bool | IsDirectory (const FileSpec &file_spec) const |
Returns whether the given path is a directory. | |
bool | IsDirectory (const llvm::Twine &path) const |
bool | IsLocal (const FileSpec &file_spec) const |
Returns whether the given path is local to the file system. | |
bool | IsLocal (const llvm::Twine &path) const |
std::error_code | MakeAbsolute (llvm::SmallVectorImpl< char > &path) const |
Make the given file path absolute. | |
std::error_code | MakeAbsolute (FileSpec &file_spec) const |
void | Resolve (llvm::SmallVectorImpl< char > &path) |
Resolve path to make it canonical. | |
void | Resolve (FileSpec &file_spec) |
Status | RemoveFile (const FileSpec &file_spec) |
Remove a single file. | |
Status | RemoveFile (const llvm::Twine &path) |
std::shared_ptr< DataBuffer > | CreateDataBuffer (const llvm::Twine &path, uint64_t size=0, uint64_t offset=0) |
Create memory buffer from path. | |
std::shared_ptr< DataBuffer > | CreateDataBuffer (const FileSpec &file_spec, uint64_t size=0, uint64_t offset=0) |
std::shared_ptr< WritableDataBuffer > | CreateWritableDataBuffer (const llvm::Twine &path, uint64_t size=0, uint64_t offset=0) |
std::shared_ptr< WritableDataBuffer > | CreateWritableDataBuffer (const FileSpec &file_spec, uint64_t size=0, uint64_t offset=0) |
Static Public Member Functions | |
static FileSystem & | Instance () |
template<class... T> | |
static void | Initialize (T &&...t) |
static void | Terminate () |
Static Public Attributes | |
static const char * | DEV_NULL = "/dev/null" |
static const char * | PATH_CONVERSION_ERROR |
Static Private Member Functions | |
static std::optional< FileSystem > & | InstanceImpl () |
Private Attributes | |
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | m_fs |
std::unique_ptr< TildeExpressionResolver > | m_tilde_resolver |
std::string | m_home_directory |
Definition at line 30 of file FileSystem.h.
typedef std::function<EnumerateDirectoryResult( llvm::sys::fs::file_type file_type, llvm::StringRef)> lldb_private::FileSystem::DirectoryCallback |
Definition at line 191 of file FileSystem.h.
typedef EnumerateDirectoryResult(* lldb_private::FileSystem::EnumerateDirectoryCallbackType) (void *baton, llvm::sys::fs::file_type file_type, llvm::StringRef) |
Definition at line 186 of file FileSystem.h.
Definition at line 176 of file FileSystem.h.
|
inline |
Definition at line 35 of file FileSystem.h.
|
inline |
Definition at line 38 of file FileSystem.h.
|
inline |
Definition at line 41 of file FileSystem.h.
|
delete |
std::shared_ptr< DataBuffer > FileSystem::CreateDataBuffer | ( | const FileSpec & | file_spec, |
uint64_t | size = 0 , |
||
uint64_t | offset = 0 |
||
) |
Definition at line 313 of file common/FileSystem.cpp.
References CreateDataBuffer(), and lldb_private::FileSpec::GetPath().
std::shared_ptr< DataBuffer > FileSystem::CreateDataBuffer | ( | const llvm::Twine & | path, |
uint64_t | size = 0 , |
||
uint64_t | offset = 0 |
||
) |
Create memory buffer from path.
Definition at line 296 of file common/FileSystem.cpp.
References IsLocal().
Referenced by lldb_private::SourceManager::File::CommonInitializer(), CreateDataBuffer(), ObjectContainerBSDArchive::CreateInstance(), ProcessMachCore::CreateInstance(), lldb_private::minidump::ProcessMinidump::CreateInstance(), ProcessElfCore::CreateInstance(), CommandObjectMemoryWrite::DoExecute(), lldb_private::ObjectFile::FindPlugin(), GetELFProcessCPUType(), lldb_private::OptionValueFileSpec::GetFileContents(), lldb_private::ObjectFile::GetModuleSpecifications(), ObjectContainerBSDArchive::GetModuleSpecifications(), GetNetBSDProcessCPUType(), ObjectContainerBSDArchive::GetObjectFile(), lldb_private::ObjectFile::MapFileData(), and lldb_private::ZipFileResolver::ResolveSharedLibraryPath().
std::shared_ptr< WritableDataBuffer > FileSystem::CreateWritableDataBuffer | ( | const FileSpec & | file_spec, |
uint64_t | size = 0 , |
||
uint64_t | offset = 0 |
||
) |
Definition at line 307 of file common/FileSystem.cpp.
References CreateWritableDataBuffer(), and lldb_private::FileSpec::GetPath().
std::shared_ptr< WritableDataBuffer > FileSystem::CreateWritableDataBuffer | ( | const llvm::Twine & | path, |
uint64_t | size = 0 , |
||
uint64_t | offset = 0 |
||
) |
Definition at line 284 of file common/FileSystem.cpp.
References IsLocal().
Referenced by CreateWritableDataBuffer(), ObjectFileELF::MapFileDataWritable(), ObjectFileXCOFF::MapFileDataWritable(), and lldb_private::Host::RunShellCommand().
vfs::directory_iterator FileSystem::DirBegin | ( | const FileSpec & | file_spec, |
std::error_code & | ec | ||
) |
Get a directory iterator.
Definition at line 57 of file common/FileSystem.cpp.
References DirBegin(), and lldb_private::FileSpec::GetPath().
Referenced by DirBegin(), and DiskFilesOrDirectories().
llvm::vfs::directory_iterator lldb_private::FileSystem::DirBegin | ( | const llvm::Twine & | dir, |
std::error_code & | ec | ||
) |
void FileSystem::EnumerateDirectory | ( | llvm::Twine | path, |
bool | find_directories, | ||
bool | find_files, | ||
bool | find_other, | ||
EnumerateDirectoryCallbackType | callback, | ||
void * | callback_baton | ||
) |
Definition at line 172 of file common/FileSystem.cpp.
References eEnumerateDirectoryResultNext, eEnumerateDirectoryResultQuit, and m_fs.
Referenced by lldb_private::PlatformDarwin::FindSDKInXcodeForModules(), lldb_private::PluginManager::Initialize(), lldb_private::Platform::Install(), lldb_private::Debugger::InstanceInitialize(), RecurseCopy_Callback(), and lldb_private::PlatformDarwinDevice::UpdateSDKDirectoryInfosIfNeeded().
bool FileSystem::Exists | ( | const FileSpec & | file_spec | ) | const |
Returns whether the given file exists.
Definition at line 139 of file common/FileSystem.cpp.
References Exists(), and lldb_private::FileSpec::GetPath().
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::CanDebug(), lldb_private::ProcessWindows::CanDebug(), lldb_private::TargetProperties::CheckJITObjectsDir(), lldb_private::HostInfoLinux::ComputeSupportExeDirectory(), lldb_private::HostInfoAndroid::ComputeTempFileBaseDirectory(), lldb_private::TargetList::CreateTargetInternal(), CommandObjectTargetSymbolsAdd::DoExecute(), CommandObjectTargetCreate::DoExecute(), lldb::SBFileSpec::Exists(), Exists(), lldb_private::ObjectFile::FindPlugin(), lldb_private::process_gdb_remote::GDBRemoteCommunication::GetDebugserverPath(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), lldb_private::Platform::GetFileExists(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(), lldb_private::MonitoringProcessLauncher::LaunchProcess(), lldb_private::DynamicLoader::LoadBinaryWithUUIDAndAddress(), lldb_private::PlatformDarwin::LocateExecutable(), lldb_private::SymbolLocatorDebugSymbols::LocateExecutableObjectFile(), lldb_private::PlatformDarwin::LocateExecutableScriptingResources(), lldb_private::SymbolLocatorDefault::LocateExecutableSymbolFile(), LocateMacOSXFilesUsingDebugSymbols(), lldb_private::DataFileCache::RemoveCacheFile(), Resolve(), ResolveExecutableLocation(), and VerifyPathExists().
bool lldb_private::FileSystem::Exists | ( | const llvm::Twine & | path | ) | const |
FILE * FileSystem::Fopen | ( | const char * | path, |
const char * | mode | ||
) |
Wraps ::fopen in a platform-independent way.
Definition at line 73 of file FileSystemPosix.cpp.
Referenced by lldb_private::Instruction::TestEmulation().
uint64_t FileSystem::GetByteSize | ( | const FileSpec & | file_spec | ) | const |
Returns the on-disk size of the given file in bytes.
Definition at line 98 of file common/FileSystem.cpp.
References GetByteSize(), and lldb_private::FileSpec::GetPath().
Referenced by lldb_private::ObjectFile::FindPlugin(), GetByteSize(), lldb_private::ObjectFile::GetModuleSpecifications(), lldb_private::Module::GetObjectFile(), lldb_private::ModuleSpec::ModuleSpec(), lldb_private::ZipFileResolver::ResolveSharedLibraryPath(), and lldb_private::Host::RunShellCommand().
uint64_t lldb_private::FileSystem::GetByteSize | ( | const llvm::Twine & | path | ) | const |
bool FileSystem::GetHomeDirectory | ( | FileSpec & | file_spec | ) | const |
Definition at line 359 of file common/FileSystem.cpp.
References GetHomeDirectory(), and lldb_private::FileSpec::SetPath().
bool FileSystem::GetHomeDirectory | ( | llvm::SmallVectorImpl< char > & | path | ) | const |
Get the user home directory.
Definition at line 351 of file common/FileSystem.cpp.
References m_home_directory.
Referenced by lldb_private::line_editor::EditlineHistory::GetHistoryFilePath(), GetHomeDirectory(), GetHomeREPLInitFile(), and lldb::SBHostOS::GetUserHomeDirectory().
sys::TimePoint FileSystem::GetModificationTime | ( | const FileSpec & | file_spec | ) | const |
Returns the modification time of the given file.
Definition at line 85 of file common/FileSystem.cpp.
References GetModificationTime(), and lldb_private::FileSpec::GetPath().
Referenced by lldb_private::CacheSignature::CacheSignature(), lldb_private::Module::FileHasChanged(), lldb_private::DynamicLoaderDarwin::FindTargetModuleForImageInfo(), lldb_private::OptionValueFileSpec::GetFileContents(), GetModificationTime(), ObjectContainerBSDArchive::GetModuleSpecifications(), lldb_private::ModuleList::GetSharedModule(), lldb_private::SourceManager::File::ModificationTimeIsStale(), lldb_private::Module::Module(), lldb_private::Module::SetFileSpecAndObjectName(), and lldb_private::SourceManager::File::SetSupportFile().
llvm::sys::TimePoint lldb_private::FileSystem::GetModificationTime | ( | const llvm::Twine & | path | ) | const |
uint32_t FileSystem::GetPermissions | ( | const FileSpec & | file_spec | ) | const |
Return the current permissions of the given file.
Returns a bitmask for the current permissions of the file (zero or more of the permission bits defined in File::Permissions).
Definition at line 111 of file common/FileSystem.cpp.
References lldb_private::FileSpec::GetPath(), and GetPermissions().
Referenced by GetPermissions(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Mode(), and lldb_private::Platform::Install().
uint32_t FileSystem::GetPermissions | ( | const FileSpec & | file_spec, |
std::error_code & | ec | ||
) | const |
Definition at line 115 of file common/FileSystem.cpp.
References lldb_private::FileSpec::GetPath(), and GetPermissions().
uint32_t lldb_private::FileSystem::GetPermissions | ( | const llvm::Twine & | path | ) | const |
uint32_t lldb_private::FileSystem::GetPermissions | ( | const llvm::Twine & | path, |
std::error_code & | ec | ||
) | const |
std::error_code FileSystem::GetRealPath | ( | const llvm::Twine & | path, |
llvm::SmallVectorImpl< char > & | output | ||
) | const |
Definition at line 219 of file common/FileSystem.cpp.
References m_fs.
llvm::ErrorOr< vfs::Status > FileSystem::GetStatus | ( | const FileSpec & | file_spec | ) | const |
Returns the Status object for the given file.
Definition at line 73 of file common/FileSystem.cpp.
References lldb_private::FileSpec::GetPath(), and GetStatus().
Referenced by DiskFilesOrDirectories(), and GetStatus().
llvm::ErrorOr< llvm::vfs::Status > lldb_private::FileSystem::GetStatus | ( | const llvm::Twine & | path | ) | const |
|
inline |
Definition at line 201 of file FileSystem.h.
References m_fs.
Referenced by lldb_private::SymbolLocatorDebugSymbols::FindSymbolFileInBundle(), and sdkSupportsBuiltinModules().
|
inlinestatic |
Definition at line 50 of file FileSystem.h.
References InstanceImpl(), and lldbassert.
Referenced by lldb_private::SystemInitializerCommon::Initialize().
|
static |
Definition at line 45 of file common/FileSystem.cpp.
References InstanceImpl().
Referenced by lldb_private::PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(), lldb::SBTarget::AddModule(), lldb_private::process_gdb_remote::ProcessGDBRemote::BuildDynamicRegisterInfo(), lldb_private::NativeProcessWindows::CacheLoadedModules(), lldb_private::CacheSignature::CacheSignature(), lldb_private::Platform::CallLocateModuleCallbackIfSet(), ProcessElfCore::CanDebug(), lldb_private::process_gdb_remote::ProcessGDBRemote::CanDebug(), ProcessMachCore::CanDebug(), lldb_private::ProcessWindows::CanDebug(), lldb_private::TargetProperties::CheckJITObjectsDir(), lldb_private::ClangExpressionParser::ClangExpressionParser(), lldb_private::SourceManager::File::CommonInitializer(), lldb_private::ComputeClangResourceDirectory(), lldb_private::HostInfoLinux::ComputeSupportExeDirectory(), lldb_private::HostInfoLinux::ComputeSystemPluginsDirectory(), lldb_private::HostInfoAndroid::ComputeTempFileBaseDirectory(), lldb_private::HostInfoBase::ComputeTempFileBaseDirectory(), lldb_private::HostInfoMacOSX::ComputeUserPluginsDirectory(), lldb_private::ConnectionFileDescriptor::ConnectFile(), lldb_private::ConnectionFileDescriptor::ConnectSerialPort(), lldb_private::ScriptInterpreterIORedirect::Create(), lldb_private::ClangModulesDeclVendor::Create(), lldb_private::TypeSystemClang::CreateASTContext(), ObjectContainerBSDArchive::CreateInstance(), SymbolVendorELF::CreateInstance(), SymbolVendorMacOSX::CreateInstance(), SymbolVendorPECOFF::CreateInstance(), lldb_private::wasm::SymbolVendorWasm::CreateInstance(), ProcessMachCore::CreateInstance(), lldb_private::minidump::ProcessMinidump::CreateInstance(), ProcessElfCore::CreateInstance(), lldb_private::Platform::CreateSymlink(), lldb_private::TargetList::CreateTargetInternal(), lldb_private::PlatformQemuUser::DebugProcess(), DefaultComputeClangResourceDirectory(), DiskFilesOrDirectories(), ProcessKDP::DoConnectRemote(), CommandObjectLogDump::DoExecute(), CommandObjectPlatformInstall::DoExecute(), CommandObjectSettingsWrite::DoExecute(), CommandObjectTargetModulesAdd::DoExecute(), CommandObjectTargetSymbolsAdd::DoExecute(), CommandObjectBreakpointRead::DoExecute(), CommandObjectBreakpointWrite::DoExecute(), CommandObjectCommandsSource::DoExecute(), CommandObjectMemoryRead::DoExecute(), CommandObjectMemoryWrite::DoExecute(), CommandObjectPluginLoad::DoExecute(), CommandObjectProcessLoad::DoExecute(), CommandObjectProcessSaveCore::DoExecute(), CommandObjectSettingsRead::DoExecute(), CommandObjectTargetCreate::DoExecute(), CommandObjectTargetModulesDumpClangPCMInfo::DoExecute(), CommandObjectTraceSave::DoExecute(), lldb_private::SymbolLocatorDebugSymbols::DownloadObjectAndSymbolFile(), lldb::DumpProcessGDBRemotePacketHistory(), DupDescriptor(), lldb_private::Debugger::EnableLog(), lldb::SBFileSpec::Exists(), lldb_private::Module::FileHasChanged(), lldb_private::PlatformDarwin::FindBundleBinaryInExecSearchPaths(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::FindModuleFile(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::FindModuleFile(), lldb_private::ObjectFile::FindPlugin(), lldb_private::SymbolVendor::FindPlugin(), lldb_private::PlatformDarwin::FindSDKInXcodeForModules(), lldb_private::SymbolLocatorDebugSymbols::FindSymbolFileInBundle(), lldb_private::DynamicLoaderDarwin::FindTargetModuleForImageInfo(), lldb_private::ModuleCache::Get(), GetCommandLineToolsLibraryPath(), lldb_private::PlatformAppleSimulator::GetCoreSimulatorPath(), GetCwdInitFile(), lldb_private::process_gdb_remote::GDBRemoteCommunication::GetDebugserverPath(), ObjectFileMachO::GetDependentModules(), GetDsymForUUIDExecutable(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwpSymbolFile(), GetELFProcessCPUType(), GetEnvDeveloperDir(), lldb_private::SourceManager::GetFile(), lldb_private::OptionValueFileSpec::GetFileContents(), lldb_private::Platform::GetFileExists(), lldb_private::PlatformRemoteDarwinDevice::GetFileInSDK(), lldb_private::NativeProcessWindows::GetFileLoadAddress(), lldb_private::line_editor::EditlineHistory::GetHistoryFilePath(), GetHomeREPLInitFile(), lldb_private::process_freebsd::NativeProcessFreeBSD::GetLoadedModuleFileSpec(), lldb_private::process_linux::NativeProcessLinux::GetLoadedModuleFileSpec(), lldb_private::process_netbsd::NativeProcessNetBSD::GetLoadedModuleFileSpec(), lldb_private::NativeProcessWindows::GetLoadedModuleFileSpec(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(), lldb_private::Host::GetModuleFileSpecForHostAddress(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::GetModuleInfo(), lldb::SBModuleSpecList::GetModuleSpecifications(), lldb_private::ObjectFile::GetModuleSpecifications(), ObjectContainerBSDArchive::GetModuleSpecifications(), GetModuleSpecInfoFromUUIDDictionary(), GetNetBSDProcessCPUType(), lldb_private::Module::GetObjectFile(), ObjectContainerBSDArchive::GetObjectFile(), lldb_private::PlatformMacOSX::GetSDKDirectory(), lldb_private::PlatformDarwin::GetSDKDirectoryForModules(), lldb_private::ModuleList::GetSharedModule(), lldb_private::PlatformDarwin::GetSharedModule(), lldb_private::PlatformDarwinDevice::GetSharedModuleWithLocalCache(), lldb_private::PlatformAppleSimulator::GetSymbolFile(), lldb_private::PlatformRemoteDarwinDevice::GetSymbolFile(), lldb_private::DynamicLoader::GetTargetExecutable(), DynamicLoaderHexagonDYLD::GetTargetExecutable(), GetTripleForProcess(), lldb::SBHostOS::GetUserHomeDirectory(), lldb_private::Platform::GetWorkingDirectory(), lldb_private::HostInfoMacOSX::GetXcodeContentsDirectory(), lldb_private::HostInfoMacOSX::GetXcodeDeveloperDirectory(), GetXcodeSDK(), GetXcodeSelectPath(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_shell(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Mode(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Open(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_symlink(), lldb_private::CommandInterpreter::HandleCommandsFromFile(), CommandObjectBreakpointRead::CommandOptions::HandleOptionArgumentCompletion(), lldb_private::CppModuleConfiguration::hasValidConfig(), lldb_private::ClangHighlighter::Highlight(), lldb_private::PluginManager::Initialize(), lldb::SBDebugger::InitializeWithErrorHandling(), lldb_private::Platform::Install(), lldb_private::Debugger::InstanceInitialize(), lldb_private::platform_android::AdbClient::SyncService::internalPushFile(), lldb_private::REPL::IOHandlerInputComplete(), IsDwpSymbolFile(), lldb_private::ObjectFile::IsObjectFile(), lldb_private::Process::LaunchPrivate(), lldb_private::MonitoringProcessLauncher::LaunchProcess(), lldb_private::ProcessDebugger::LaunchProcess(), lldb_private::DynamicLoader::LoadBinaryWithUUIDAndAddress(), lldb::SBTarget::LoadCore(), DynamicLoaderFreeBSDKernel::KModImageInfo::LoadImageUsingMemoryModule(), DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(), loadMatchingPDBFile(), lldb_private::Lua::LoadModule(), lldb_private::process_gdb_remote::ProcessGDBRemote::LoadModules(), LoadPluginCallback(), lldb_private::Module::LoadScriptingResourceInTarget(), lldb_private::PlatformDarwin::LocateExecutable(), lldb_private::SymbolLocatorDebugSymbols::LocateExecutableObjectFile(), lldb_private::PlatformDarwin::LocateExecutableScriptingResources(), lldb_private::SymbolLocatorDefault::LocateExecutableSymbolFile(), LocateMacOSXFilesUsingDebugSymbols(), LookForDsymNextToExecutablePath(), lldb_private::ObjectFile::MapFileData(), ObjectFileELF::MapFileDataWritable(), ObjectFileXCOFF::MapFileDataWritable(), lldb_private::SourceManager::File::ModificationTimeIsStale(), lldb_private::Module::Module(), lldb_private::ModuleSpec::ModuleSpec(), lldb_private::ProcessWindows::OnDebuggerConnected(), lldb_private::PipePosix::OpenAsReader(), lldb_private::FileCache::OpenFile(), lldb_private::PseudoTerminal::OpenSecondary(), ObjectFileELF::ParseDependentModules(), DynamicLoaderMacOSXDYLD::ParseLoadCommands(), ObjectFileMachO::ParseSymtab(), lldb_private::PlatformProperties::PlatformProperties(), lldb_private::process_linux::NativeProcessLinux::PopulateMemoryRegionCache(), lldb_private::Property::Property(), lldb_private::Platform::PutFile(), ReadCode(), RecurseCopy_Callback(), lldb::SBStream::RedirectToFile(), DynamicLoaderHexagonDYLD::RefreshModules(), lldb_private::PathMappingList::RemapPath(), lldb_private::DataFileCache::RemoveCacheFile(), resolve_tilde(), ResolveAndVerifyCandidateSupportDir(), lldb_private::Platform::ResolveExecutable(), lldb_private::RemoteAwarePlatform::ResolveExecutable(), lldb::SBFileSpec::ResolveExecutableLocation(), lldb_private::HostInfoAndroid::ResolveLibraryPath(), lldb::SBFileSpec::ResolvePath(), lldb_private::Platform::ResolveRemotePath(), lldb_private::ZipFileResolver::ResolveSharedLibraryPath(), lldb_private::Platform::ResolveSymbolFile(), lldb_private::PlatformDarwin::ResolveSymbolFile(), lldb_private::Host::RunShellCommand(), ObjectFileMachO::SaveCore(), ObjectFileMinidump::SaveCore(), lldb_private::trace_intel_pt::TraceIntelPTBundleSaver::SaveToDisk(), lldb_private::CommandInterpreter::SaveTranscript(), lldb::SBFileSpec::SBFileSpec(), sdkSupportsBuiltinModules(), lldb_private::Module::SetFileSpecAndObjectName(), CommandObjectLogEnable::CommandOptions::SetOptionValue(), CommandObjectLogDump::CommandOptions::SetOptionValue(), CommandObjectMemoryWrite::OptionGroupWriteMemory::SetOptionValue(), lldb_private::ProcessLaunchInfo::SetShell(), lldb_private::SourceManager::File::SetSupportFile(), lldb_private::Module::SetSymbolFileFileSpec(), lldb_private::OptionValueFileSpec::SetValueFromString(), lldb_private::CommandInterpreter::SourceInitFile(), lldb_private::CommandInterpreter::SourceInitFileCwd(), lldb_private::CommandInterpreter::SourceInitFileHome(), lldb_private::ObjectFile::SplitArchivePathWithObject(), lldb_private::StreamFile::StreamFile(), lldb_private::Instruction::TestEmulation(), lldb_private::plugin::dwarf::SymbolFileDWARF::UpdateExternalModuleListIfNeeded(), lldb_private::PlatformDarwinDevice::UpdateSDKDirectoryInfosIfNeeded(), lldb_private::ModuleListProperties::UpdateSymlinkMappings(), VerifyClangPath(), and VerifyPathExists().
|
staticprivate |
Definition at line 52 of file common/FileSystem.cpp.
Referenced by Initialize(), Instance(), and Terminate().
bool FileSystem::IsDirectory | ( | const FileSpec & | file_spec | ) | const |
Returns whether the given path is a directory.
Definition at line 158 of file common/FileSystem.cpp.
References lldb_private::FileSpec::GetPath(), and IsDirectory().
Referenced by lldb_private::TargetProperties::CheckJITObjectsDir(), DiskFilesOrDirectories(), IsDirectory(), and ResolveAndVerifyCandidateSupportDir().
bool lldb_private::FileSystem::IsDirectory | ( | const llvm::Twine & | path | ) | const |
bool FileSystem::IsLocal | ( | const FileSpec & | file_spec | ) | const |
Returns whether the given path is local to the file system.
Definition at line 168 of file common/FileSystem.cpp.
References lldb_private::FileSpec::GetPath(), and IsLocal().
Referenced by CreateDataBuffer(), CreateWritableDataBuffer(), and IsLocal().
bool lldb_private::FileSystem::IsLocal | ( | const llvm::Twine & | path | ) | const |
std::error_code FileSystem::MakeAbsolute | ( | FileSpec & | file_spec | ) | const |
Definition at line 206 of file common/FileSystem.cpp.
References lldb_private::FileSpec::GetPath(), lldb_private::FileSpec::GetPathStyle(), and MakeAbsolute().
std::error_code FileSystem::MakeAbsolute | ( | llvm::SmallVectorImpl< char > & | path | ) | const |
Make the given file path absolute.
Definition at line 202 of file common/FileSystem.cpp.
References m_fs.
Referenced by MakeAbsolute(), and Resolve().
int FileSystem::Open | ( | const char * | path, |
int | flags, | ||
int | mode = 0600 |
||
) |
Wraps ::open in a platform-independent way.
Definition at line 77 of file FileSystemPosix.cpp.
Referenced by lldb_private::ConnectionFileDescriptor::ConnectFile(), lldb_private::ConnectionFileDescriptor::ConnectSerialPort(), lldb_private::ScriptInterpreterIORedirect::Create(), CommandObjectLogDump::DoExecute(), CommandObjectMemoryRead::DoExecute(), CommandObjectTargetCreate::DoExecute(), lldb::DumpProcessGDBRemotePacketHistory(), DupDescriptor(), lldb_private::Debugger::EnableLog(), GetTripleForProcess(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Open(), lldb_private::CommandInterpreter::HandleCommandsFromFile(), lldb_private::REPL::IOHandlerInputComplete(), lldb_private::PipePosix::OpenAsReader(), lldb_private::FileCache::OpenFile(), lldb_private::PseudoTerminal::OpenSecondary(), lldb_private::Platform::PutFile(), lldb::SBStream::RedirectToFile(), ObjectFileMachO::SaveCore(), ObjectFileMinidump::SaveCore(), lldb_private::CommandInterpreter::SaveTranscript(), and lldb_private::StreamFile::StreamFile().
Expected< FileUP > FileSystem::Open | ( | const FileSpec & | file_spec, |
File::OpenOptions | options, | ||
uint32_t | permissions = lldb::eFilePermissionsFileDefault , |
||
bool | should_close_fd = true |
||
) |
Definition at line 438 of file common/FileSystem.cpp.
References lldb_private::File::DescriptorIsValid(), GetOpenFlags(), GetOpenMode(), lldb_private::FileSpec::GetPath(), and OpenWithFS().
|
delete |
bool FileSystem::Readable | ( | const FileSpec & | file_spec | ) | const |
Returns whether the given file is readable.
Definition at line 147 of file common/FileSystem.cpp.
References lldb_private::FileSpec::GetPath(), and Readable().
Referenced by Readable().
bool lldb_private::FileSystem::Readable | ( | const llvm::Twine & | path | ) | const |
Definition at line 43 of file FileSystemPosix.cpp.
References error(), lldb_private::Status::FromErrno(), lldb_private::FileSpec::GetPath(), PATH_MAX, and lldb_private::FileSpec::SetFile().
Referenced by lldb_private::Platform::Install(), RecurseCopy_Callback(), and lldb_private::ModuleListProperties::UpdateSymlinkMappings().
Remove a single file.
The path must specify a file and not a directory.
Definition at line 464 of file common/FileSystem.cpp.
References lldb_private::FileSpec::GetPath(), and RemoveFile().
Referenced by lldb_private::DataFileCache::RemoveCacheFile(), and RemoveFile().
Status FileSystem::RemoveFile | ( | const llvm::Twine & | path | ) |
Definition at line 468 of file common/FileSystem.cpp.
void FileSystem::Resolve | ( | FileSpec & | file_spec | ) |
Definition at line 246 of file common/FileSystem.cpp.
References lldb_private::FileSpec::GetFilename(), lldb_private::FileSpec::GetPath(), lldb_private::ConstString::IsEmpty(), Resolve(), lldb_private::FileSpec::SetDirectory(), and lldb_private::FileSpec::SetPath().
void FileSystem::Resolve | ( | llvm::SmallVectorImpl< char > & | path | ) |
Resolve path to make it canonical.
Definition at line 224 of file common/FileSystem.cpp.
References Exists(), m_tilde_resolver, and MakeAbsolute().
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::BuildDynamicRegisterInfo(), lldb_private::NativeProcessWindows::CacheLoadedModules(), lldb_private::ComputeClangResourceDirectory(), lldb_private::HostInfoLinux::ComputeSystemPluginsDirectory(), lldb_private::HostInfoBase::ComputeTempFileBaseDirectory(), lldb_private::HostInfoMacOSX::ComputeUserPluginsDirectory(), SymbolVendorELF::CreateInstance(), SymbolVendorPECOFF::CreateInstance(), lldb_private::wasm::SymbolVendorWasm::CreateInstance(), lldb_private::TargetList::CreateTargetInternal(), DefaultComputeClangResourceDirectory(), CommandObjectPlatformInstall::DoExecute(), CommandObjectSettingsWrite::DoExecute(), CommandObjectTargetSymbolsAdd::DoExecute(), CommandObjectBreakpointRead::DoExecute(), CommandObjectBreakpointWrite::DoExecute(), CommandObjectCommandsSource::DoExecute(), CommandObjectPluginLoad::DoExecute(), CommandObjectProcessLoad::DoExecute(), CommandObjectProcessSaveCore::DoExecute(), CommandObjectSettingsRead::DoExecute(), CommandObjectTargetCreate::DoExecute(), CommandObjectTraceSave::DoExecute(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::FindModuleFile(), lldb_private::PlatformAppleSimulator::GetCoreSimulatorPath(), GetCwdInitFile(), ObjectFileMachO::GetDependentModules(), GetDsymForUUIDExecutable(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), lldb_private::PlatformRemoteDarwinDevice::GetFileInSDK(), lldb_private::NativeProcessWindows::GetFileLoadAddress(), GetHomeREPLInitFile(), lldb_private::process_freebsd::NativeProcessFreeBSD::GetLoadedModuleFileSpec(), lldb_private::process_linux::NativeProcessLinux::GetLoadedModuleFileSpec(), lldb_private::process_netbsd::NativeProcessNetBSD::GetLoadedModuleFileSpec(), lldb_private::NativeProcessWindows::GetLoadedModuleFileSpec(), lldb_private::Host::GetModuleFileSpecForHostAddress(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::GetModuleInfo(), lldb::SBModuleSpecList::GetModuleSpecifications(), GetModuleSpecInfoFromUUIDDictionary(), lldb_private::ModuleList::GetSharedModule(), lldb_private::PlatformDarwinDevice::GetSharedModuleWithLocalCache(), lldb_private::PlatformAppleSimulator::GetSymbolFile(), lldb_private::PlatformRemoteDarwinDevice::GetSymbolFile(), lldb::SBHostOS::GetUserHomeDirectory(), lldb_private::Platform::GetWorkingDirectory(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_shell(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Mode(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_Open(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_symlink(), CommandObjectBreakpointRead::CommandOptions::HandleOptionArgumentCompletion(), lldb_private::MonitoringProcessLauncher::LaunchProcess(), lldb_private::ProcessDebugger::LaunchProcess(), lldb::SBTarget::LoadCore(), lldb_private::process_gdb_remote::ProcessGDBRemote::LoadModules(), LoadPluginCallback(), lldb_private::SymbolLocatorDebugSymbols::LocateExecutableObjectFile(), lldb_private::PlatformDarwin::LocateExecutableScriptingResources(), lldb_private::SymbolLocatorDefault::LocateExecutableSymbolFile(), LocateMacOSXFilesUsingDebugSymbols(), lldb_private::ProcessWindows::OnDebuggerConnected(), ObjectFileELF::ParseDependentModules(), DynamicLoaderMacOSXDYLD::ParseLoadCommands(), lldb_private::process_linux::NativeProcessLinux::PopulateMemoryRegionCache(), lldb_private::Property::Property(), DynamicLoaderHexagonDYLD::RefreshModules(), Resolve(), resolve_tilde(), ResolveAndVerifyCandidateSupportDir(), lldb_private::RemoteAwarePlatform::ResolveExecutable(), lldb_private::HostInfoAndroid::ResolveLibraryPath(), lldb::SBFileSpec::ResolvePath(), lldb_private::Platform::ResolveRemotePath(), lldb_private::trace_intel_pt::TraceIntelPTBundleSaver::SaveToDisk(), lldb_private::CommandInterpreter::SaveTranscript(), lldb::SBFileSpec::SBFileSpec(), CommandObjectLogEnable::CommandOptions::SetOptionValue(), CommandObjectLogDump::CommandOptions::SetOptionValue(), CommandObjectMemoryWrite::OptionGroupWriteMemory::SetOptionValue(), lldb_private::OptionValueFileSpec::SetValueFromString(), lldb_private::plugin::dwarf::SymbolFileDWARF::UpdateExternalModuleListIfNeeded(), and lldb_private::PlatformDarwinDevice::UpdateSDKDirectoryInfosIfNeeded().
bool FileSystem::ResolveExecutableLocation | ( | FileSpec & | file_spec | ) |
Call into the Host to see if it can help find the file.
Definition at line 318 of file common/FileSystem.cpp.
References Exists(), lldb_private::ConstString::GetCString(), lldb_private::FileSpec::GetDirectory(), and lldb_private::FileSpec::GetFilename().
Referenced by lldb_private::TargetList::CreateTargetInternal(), lldb_private::PlatformQemuUser::DebugProcess(), CommandObjectTargetCreate::DoExecute(), lldb_private::MonitoringProcessLauncher::LaunchProcess(), lldb_private::RemoteAwarePlatform::ResolveExecutable(), lldb::SBFileSpec::ResolveExecutableLocation(), and lldb_private::ProcessLaunchInfo::SetShell().
Definition at line 56 of file FileSystemPosix.cpp.
References lldb_private::Status::FromErrno(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::FileSpec::GetPath(), and PATH_MAX.
Referenced by DiskFilesOrDirectories(), and lldb_private::SymbolLocatorDefault::LocateExecutableSymbolFile().
void FileSystem::SetHomeDirectory | ( | std::string | home_directory | ) |
Definition at line 460 of file common/FileSystem.cpp.
References m_home_directory.
Definition at line 36 of file FileSystemPosix.cpp.
References error(), lldb_private::Status::FromErrno(), and lldb_private::FileSpec::GetPath().
Referenced by lldb_private::Platform::CreateSymlink(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_vFile_symlink().
|
static |
Definition at line 47 of file common/FileSystem.cpp.
References InstanceImpl(), and lldbassert.
Referenced by lldb_private::SystemInitializerCommon::Terminate().
|
static |
Definition at line 32 of file FileSystem.h.
Referenced by lldb_private::ProcessLaunchInfo::AppendSuppressFileAction(), lldb_private::ScriptInterpreterIORedirect::Create(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoLaunch(), and lldb_private::CommandOptionsProcessLaunch::SetOptionValue().
|
private |
Definition at line 209 of file FileSystem.h.
Referenced by EnumerateDirectory(), GetRealPath(), GetVirtualFileSystem(), and MakeAbsolute().
|
private |
Definition at line 211 of file FileSystem.h.
Referenced by GetHomeDirectory(), and SetHomeDirectory().
|
private |
Definition at line 210 of file FileSystem.h.
Referenced by Resolve().
|
static |
Definition at line 33 of file FileSystem.h.