Lines Matching full:platform

1 //===-- Platform.cpp ------------------------------------------------------===//
33 #include "lldb/Target/Platform.h"
62 const char *Platform::GetHostPlatformName() { return "host"; } in GetHostPlatformName()
77 static ConstString g_setting_name("platform"); in GetSettingName()
129 /// Get the native host platform plug-in.
135 /// This platform will be used as the default platform when launching
136 /// or attaching to processes unless another platform is specified.
137 PlatformSP Platform::GetHostPlatform() { return GetHostPlatformSP(); } in GetHostPlatform()
139 void Platform::Initialize() {} in Initialize()
141 void Platform::Terminate() {} in Terminate()
143 PlatformProperties &Platform::GetGlobalPlatformProperties() { in GetGlobalPlatformProperties()
148 void Platform::SetHostPlatform(const lldb::PlatformSP &platform_sp) { in SetHostPlatform()
149 // The native platform should use its static void Platform::Initialize() in SetHostPlatform()
150 // function to register itself as the native platform. in SetHostPlatform()
154 Status Platform::GetFileWithUUID(const FileSpec &platform_file, in GetFileWithUUID()
162 Platform::LocateExecutableScriptingResources(Target *target, Module &module, in LocateExecutableScriptingResources()
168 // Platform::FindPlugin (Process *process, ConstString plugin_name)
201 Status Platform::GetSharedModule( in GetSharedModule()
242 bool Platform::GetModuleSpec(const FileSpec &module_file_spec, in GetModuleSpec()
254 PlatformSP Platform::Create(llvm::StringRef name) { in Create()
265 ArchSpec Platform::GetAugmentedArchSpec(Platform *platform, llvm::StringRef triple) { in GetAugmentedArchSpec() argument
266 if (platform) in GetAugmentedArchSpec()
267 return platform->GetAugmentedArchSpec(triple); in GetAugmentedArchSpec()
272 Platform::Platform(bool is_host) in Platform() function in Platform
281 LLDB_LOGF(log, "%p Platform::Platform()", static_cast<void *>(this)); in Platform()
284 Platform::~Platform() = default;
286 void Platform::GetStatus(Stream &strm) { in GetStatus()
287 strm.Format(" Platform: {0}\n", GetPluginName()); in GetStatus()
329 strm.Printf("Platform-specific connection: %s\n", specific_info.c_str()); in GetStatus()
335 llvm::VersionTuple Platform::GetOSVersion(Process *process) { in GetOSVersion()
340 // We have a local host platform in GetOSVersion()
345 // We have a remote platform. We can only fetch the remote in GetOSVersion()
377 std::optional<std::string> Platform::GetOSBuildString() { in GetOSBuildString()
383 std::optional<std::string> Platform::GetOSKernelDescription() { in GetOSKernelDescription()
389 void Platform::AddClangModuleCompilationOptions( in AddClangModuleCompilationOptions()
398 FileSpec Platform::GetWorkingDirectory() { in GetWorkingDirectory()
417 Platform *platform_ptr;
510 Status Platform::Install(const FileSpec &src, const FileSpec &dst) { in Install()
513 Log *log = GetLog(LLDBLog::Platform); in Install()
514 LLDB_LOGF(log, "Platform::Install (src='%s', dst='%s')", in Install()
531 // the platform's working directory in Install()
541 "platform working directory must be valid for relative path '%s'", in Install()
551 "platform working directory must be valid for relative path '%s'", in Install()
560 error.SetErrorStringWithFormat("platform working directory must be valid " in Install()
566 LLDB_LOGF(log, "Platform::Install (src='%s', dst='%s') fixed_dst='%s'", in Install()
607 error.SetErrorString("platform install doesn't handle pipes"); in Install()
610 error.SetErrorString("platform install doesn't handle sockets"); in Install()
614 "platform install doesn't handle non file or directory items"); in Install()
621 bool Platform::SetWorkingDirectory(const FileSpec &file_spec) { in SetWorkingDirectory()
623 Log *log = GetLog(LLDBLog::Platform); in SetWorkingDirectory()
636 Status Platform::MakeDirectory(const FileSpec &file_spec, in MakeDirectory()
642 error.SetErrorStringWithFormatv("remote platform {0} doesn't support {1}", in MakeDirectory()
648 Status Platform::GetFilePermissions(const FileSpec &file_spec, in GetFilePermissions()
657 error.SetErrorStringWithFormatv("remote platform {0} doesn't support {1}", in GetFilePermissions()
663 Status Platform::SetFilePermissions(const FileSpec &file_spec, in SetFilePermissions()
670 error.SetErrorStringWithFormatv("remote platform {0} doesn't support {1}", in SetFilePermissions()
676 user_id_t Platform::OpenFile(const FileSpec &file_spec, in OpenFile()
684 bool Platform::CloseFile(user_id_t fd, Status &error) { in CloseFile()
690 user_id_t Platform::GetFileSize(const FileSpec &file_spec) { in GetFileSize()
700 uint64_t Platform::ReadFile(lldb::user_id_t fd, uint64_t offset, void *dst, in ReadFile()
705 "Platform::ReadFile() is not supported in the {0} platform", in ReadFile()
710 uint64_t Platform::WriteFile(lldb::user_id_t fd, uint64_t offset, in WriteFile()
715 "Platform::WriteFile() is not supported in the {0} platform", in WriteFile()
720 UserIDResolver &Platform::GetUserIDResolver() { in GetUserIDResolver()
726 const char *Platform::GetHostname() { in GetHostname()
735 ConstString Platform::GetFullNameForDylib(ConstString basename) { in GetFullNameForDylib()
739 bool Platform::SetRemoteWorkingDirectory(const FileSpec &working_dir) { in SetRemoteWorkingDirectory()
740 Log *log = GetLog(LLDBLog::Platform); in SetRemoteWorkingDirectory()
741 LLDB_LOGF(log, "Platform::SetRemoteWorkingDirectory('%s')", in SetRemoteWorkingDirectory()
747 bool Platform::SetOSVersion(llvm::VersionTuple version) { in SetOSVersion()
749 // We don't need anyone setting the OS version for the host platform, we in SetOSVersion()
753 // We have a remote platform, allow setting the target OS version if we in SetOSVersion()
755 // request the remote OS version from the connected platform. in SetOSVersion()
770 Platform::ResolveExecutable(const ModuleSpec &module_spec, in ResolveExecutable()
781 // No valid architecture was specified, ask the platform for the in ResolveExecutable()
805 Platform::ResolveRemoteExecutable(const ModuleSpec &module_spec, in ResolveRemoteExecutable()
830 // ask the platform for the architectures that we should be using (in the in ResolveRemoteExecutable()
854 "'{0}' doesn't contain any '{1}' platform architectures: {2}", in ResolveRemoteExecutable()
870 Status Platform::ResolveSymbolFile(Target &target, const ModuleSpec &sym_spec, in ResolveSymbolFile()
880 bool Platform::ResolveRemotePath(const FileSpec &platform_path, in ResolveRemotePath()
887 const ArchSpec &Platform::GetSystemArchitecture() { in GetSystemArchitecture()
890 // We have a local host platform in GetSystemArchitecture()
895 // We have a remote platform. We can only fetch the remote system in GetSystemArchitecture()
921 ArchSpec Platform::GetAugmentedArchSpec(llvm::StringRef triple) { in GetAugmentedArchSpec()
950 Status Platform::ConnectRemote(Args &args) { in ConnectRemote()
954 "The currently selected platform ({0}) is " in ConnectRemote()
955 "the host platform and is always connected.", in ConnectRemote()
959 "Platform::ConnectRemote() is not supported by {0}", GetPluginName()); in ConnectRemote()
963 Status Platform::DisconnectRemote() { in DisconnectRemote()
967 "The currently selected platform ({0}) is " in DisconnectRemote()
968 "the host platform and is always connected.", in DisconnectRemote()
972 "Platform::DisconnectRemote() is not supported by {0}", in DisconnectRemote()
977 bool Platform::GetProcessInfo(lldb::pid_t pid, in GetProcessInfo()
986 uint32_t Platform::FindProcesses(const ProcessInstanceInfoMatch &match_info, in FindProcesses()
996 Status Platform::LaunchProcess(ProcessLaunchInfo &launch_info) { in LaunchProcess()
998 Log *log = GetLog(LLDBLog::Platform); in LaunchProcess()
999 LLDB_LOGF(log, "Platform::%s()", __FUNCTION__); in LaunchProcess()
1015 "Platform::%s GetResumeCountForLaunchInfo() returned %" PRIu32 in LaunchProcess()
1034 LLDB_LOGF(log, "Platform::%s final launch_info resume count: %" PRIu32, in LaunchProcess()
1040 "base lldb_private::Platform class can't launch remote processes"); in LaunchProcess()
1044 Status Platform::ShellExpandArguments(ProcessLaunchInfo &launch_info) { in ShellExpandArguments()
1047 return Status("base lldb_private::Platform class can't expand arguments"); in ShellExpandArguments()
1050 Status Platform::KillProcess(const lldb::pid_t pid) { in KillProcess()
1051 Log *log = GetLog(LLDBLog::Platform); in KillProcess()
1052 LLDB_LOGF(log, "Platform::%s, pid %" PRIu64, __FUNCTION__, pid); in KillProcess()
1056 "base lldb_private::Platform class can't kill remote processes"); in KillProcess()
1062 lldb::ProcessSP Platform::DebugProcess(ProcessLaunchInfo &launch_info, in DebugProcess()
1065 Log *log = GetLog(LLDBLog::Platform); in DebugProcess()
1091 "Platform::%s() StructuredDataPlugin launch " in DebugProcess()
1102 "Platform::%s LaunchProcess() call succeeded (pid=%" PRIu64 ")", in DebugProcess()
1127 LLDB_LOGF(log, "Platform::%s Attach() failed: %s", __FUNCTION__, in DebugProcess()
1132 "Platform::%s LaunchProcess() returned launch_info with " in DebugProcess()
1137 LLDB_LOGF(log, "Platform::%s LaunchProcess() failed: %s", __FUNCTION__, in DebugProcess()
1145 Platform::CreateArchList(llvm::ArrayRef<llvm::Triple::ArchType> archs, in CreateArchList()
1157 /// Lets a platform answer if it is compatible with a given
1159 bool Platform::IsCompatibleArchitecture(const ArchSpec &arch, in IsCompatibleArchitecture()
1180 Status Platform::PutFile(const FileSpec &source, const FileSpec &destination, in PutFile()
1182 Log *log = GetLog(LLDBLog::Platform); in PutFile()
1240 Status Platform::GetFile(const FileSpec &source, const FileSpec &destination) { in GetFile()
1246 Platform::CreateSymlink(const FileSpec &src, // The name of the link is in src in CreateSymlink()
1254 bool Platform::GetFileExists(const lldb_private::FileSpec &file_spec) { in GetFileExists()
1260 Status Platform::Unlink(const FileSpec &path) { in Unlink()
1266 MmapArgList Platform::GetMmapArgumentList(const ArchSpec &arch, addr_t addr, in GetMmapArgumentList()
1280 lldb_private::Status Platform::RunShellCommand( in RunShellCommand()
1294 lldb_private::Status Platform::RunShellCommand( in RunShellCommand()
1309 return Status("unable to run a remote command without a platform"); in RunShellCommand()
1312 bool Platform::CalculateMD5(const FileSpec &file_spec, uint64_t &low, in CalculateMD5()
1323 void Platform::SetLocalCacheDirectory(const char *local) { in SetLocalCacheDirectory()
1327 const char *Platform::GetLocalCacheDirectory() { in GetLocalCacheDirectory()
1336 "Platform-specific options required for rsync to work."},
1339 "Platform-specific rsync prefix put before the remote path."},
1351 "Platform-specific options required for SSH to work."},
1404 Platform::SetThreadCreationBreakpoint(lldb_private::Target &target) { in SetThreadCreationBreakpoint()
1468 Environment Platform::GetEnvironment() { in GetEnvironment()
1474 const std::vector<ConstString> &Platform::GetTrapHandlerSymbolNames() { in GetTrapHandlerSymbolNames()
1486 Platform::GetCachedExecutable(ModuleSpec &module_spec, in GetCachedExecutable()
1505 Status Platform::GetRemoteSharedModule(const ModuleSpec &module_spec, in GetRemoteSharedModule()
1529 // No valid architecture was specified, ask the platform for the in GetRemoteSharedModule()
1580 bool Platform::GetCachedSharedModule(const ModuleSpec &module_spec, in GetCachedSharedModule()
1587 Log *log = GetLog(LLDBLog::Platform); in GetCachedSharedModule()
1607 LLDB_LOGF(log, "Platform::%s - module %s not found in local cache: %s", in GetCachedSharedModule()
1613 Status Platform::DownloadModuleSlice(const FileSpec &src_file_spec, in DownloadModuleSlice()
1661 Status Platform::DownloadSymbolFile(const lldb::ModuleSP &module_sp, in DownloadSymbolFile()
1664 "Symbol file downloading not supported by the default platform."); in DownloadSymbolFile()
1667 FileSpec Platform::GetModuleCacheRoot() { in GetModuleCacheRoot()
1673 const char *Platform::GetCacheHostname() { return GetHostname(); } in GetCacheHostname()
1675 const UnixSignalsSP &Platform::GetRemoteUnixSignals() { in GetRemoteUnixSignals()
1680 UnixSignalsSP Platform::GetUnixSignals() { in GetUnixSignals()
1686 uint32_t Platform::LoadImage(lldb_private::Process *process, in LoadImage()
1723 uint32_t Platform::DoLoadImage(lldb_private::Process *process, in DoLoadImage()
1728 error.SetErrorString("LoadImage is not supported on the current platform"); in DoLoadImage()
1732 uint32_t Platform::LoadImageUsingPaths(lldb_private::Process *process, in LoadImageUsingPaths()
1749 Status Platform::UnloadImage(lldb_private::Process *process, in UnloadImage()
1751 return Status("UnloadImage is not supported on the current platform"); in UnloadImage()
1754 lldb::ProcessSP Platform::ConnectProcess(llvm::StringRef connect_url, in ConnectProcess()
1762 lldb::ProcessSP Platform::ConnectProcessSynchronous( in ConnectProcessSynchronous()
1769 lldb::ProcessSP Platform::DoConnectProcess(llvm::StringRef connect_url, in DoConnectProcess()
1825 size_t Platform::ConnectToWaitingProcesses(lldb_private::Debugger &debugger, in ConnectToWaitingProcesses()
1831 size_t Platform::GetSoftwareBreakpointTrapOpcode(Target &target, in GetSoftwareBreakpointTrapOpcode()
1962 CompilerType Platform::GetSiginfoType(const llvm::Triple& triple) { in GetSiginfoType()
1966 Args Platform::GetExtraStartupCommands() { in GetExtraStartupCommands()
2000 // First try exact arch matches across all platform plug-ins in GetOrCreate()
2013 // Next try compatible arch matches across all platform plug-ins in GetOrCreate()
2048 PlatformSP host_platform_sp = Platform::GetHostPlatform(); in GetOrCreate()
2050 // Prefer the selected platform if it matches at least one architecture. in GetOrCreate()
2059 // Prefer the host platform if it matches at least one architecture. in GetOrCreate()
2070 if (PlatformSP platform = GetOrCreate(arch, process_host_arch, nullptr)) in GetOrCreate() local
2071 candidates.push_back(platform); in GetOrCreate()
2074 // The selected or host platform didn't match any of the architectures. If in GetOrCreate()
2075 // the same platform supports all architectures then that's the obvious next in GetOrCreate()
2093 PlatformSP platform_sp = Platform::Create(name); in Create()