Lines Matching full:platform
1 //===-- Platform.cpp ------------------------------------------------------===//
32 #include "lldb/Target/Platform.h"
61 const char *Platform::GetHostPlatformName() { return "host"; }
76 static constexpr llvm::StringLiteral g_setting_name("platform");
126 /// Get the native host platform plug-in.
132 /// This platform will be used as the default platform when launching
133 /// or attaching to processes unless another platform is specified.
134 PlatformSP Platform::GetHostPlatform() { return GetHostPlatformSP(); }
136 void Platform::Initialize() {}
138 void Platform::Terminate() {}
140 PlatformProperties &Platform::GetGlobalPlatformProperties() {
145 void Platform::SetHostPlatform(const lldb::PlatformSP &platform_sp) {
146 // The native platform should use its static void Platform::Initialize()
147 // function to register itself as the native platform.
151 Status Platform::GetFileWithUUID(const FileSpec &platform_file,
159 Platform::LocateExecutableScriptingResources(Target *target, Module &module,
164 Status Platform::GetSharedModule(
204 bool Platform::GetModuleSpec(const FileSpec &module_file_spec,
216 PlatformSP Platform::Create(llvm::StringRef name) {
227 ArchSpec Platform::GetAugmentedArchSpec(Platform *platform, llvm::StringRef triple) {
228 if (platform)
229 return platform->GetAugmentedArchSpec(triple);
234 Platform::Platform(bool is_host)
243 LLDB_LOGF(log, "%p Platform::Platform()", static_cast<void *>(this));
246 Platform::~Platform() = default;
248 void Platform::GetStatus(Stream &strm) {
249 strm.Format(" Platform: {0}\n", GetPluginName());
291 strm.Printf("Platform-specific connection: %s\n", specific_info.c_str());
297 llvm::VersionTuple Platform::GetOSVersion(Process *process) {
302 // We have a local host platform
307 // We have a remote platform. We can only fetch the remote
339 std::optional<std::string> Platform::GetOSBuildString() {
345 std::optional<std::string> Platform::GetOSKernelDescription() {
351 void Platform::AddClangModuleCompilationOptions(
360 FileSpec Platform::GetWorkingDirectory() {
379 Platform *platform_ptr;
471 Status Platform::Install(const FileSpec &src, const FileSpec &dst) {
474 Log *log = GetLog(LLDBLog::Platform);
475 LLDB_LOGF(log, "Platform::Install (src='%s', dst='%s')",
492 // the platform's working directory
502 "platform working directory must be valid for relative path '%s'",
512 "platform working directory must be valid for relative path '%s'",
522 Status::FromErrorString("platform working directory must be valid "
528 LLDB_LOGF(log, "Platform::Install (src='%s', dst='%s') fixed_dst='%s'",
569 error = Status::FromErrorString("platform install doesn't handle pipes");
573 Status::FromErrorString("platform install doesn't handle sockets");
577 "platform install doesn't handle non file or directory items");
584 bool Platform::SetWorkingDirectory(const FileSpec &file_spec) {
586 Log *log = GetLog(LLDBLog::Platform);
599 Status Platform::MakeDirectory(const FileSpec &file_spec,
606 "remote platform {0} doesn't support {1}", GetPluginName(),
612 Status Platform::GetFilePermissions(const FileSpec &file_spec,
622 "remote platform {0} doesn't support {1}", GetPluginName(),
628 Status Platform::SetFilePermissions(const FileSpec &file_spec,
636 "remote platform {0} doesn't support {1}", GetPluginName(),
642 user_id_t Platform::OpenFile(const FileSpec &file_spec,
650 bool Platform::CloseFile(user_id_t fd, Status &error) {
656 user_id_t Platform::GetFileSize(const FileSpec &file_spec) {
666 uint64_t Platform::ReadFile(lldb::user_id_t fd, uint64_t offset, void *dst,
671 "Platform::ReadFile() is not supported in the {0} platform",
676 uint64_t Platform::WriteFile(lldb::user_id_t fd, uint64_t offset,
681 "Platform::WriteFile() is not supported in the {0} platform",
686 UserIDResolver &Platform::GetUserIDResolver() {
692 const char *Platform::GetHostname() {
701 ConstString Platform::GetFullNameForDylib(ConstString basename) {
705 bool Platform::SetRemoteWorkingDirectory(const FileSpec &working_dir) {
706 Log *log = GetLog(LLDBLog::Platform);
707 LLDB_LOGF(log, "Platform::SetRemoteWorkingDirectory('%s')",
713 bool Platform::SetOSVersion(llvm::VersionTuple version) {
715 // We don't need anyone setting the OS version for the host platform, we
719 // We have a remote platform, allow setting the target OS version if we
721 // request the remote OS version from the connected platform.
736 Platform::ResolveExecutable(const ModuleSpec &module_spec,
763 // Ask the platform for the architectures that we should be using (in the
795 "'{0}' doesn't contain any '{1}' platform architectures: {2}",
800 Status Platform::ResolveSymbolFile(Target &target, const ModuleSpec &sym_spec,
810 bool Platform::ResolveRemotePath(const FileSpec &platform_path,
817 const ArchSpec &Platform::GetSystemArchitecture() {
820 // We have a local host platform
825 // We have a remote platform. We can only fetch the remote system
851 ArchSpec Platform::GetAugmentedArchSpec(llvm::StringRef triple) {
880 Status Platform::ConnectRemote(Args &args) {
884 "The currently selected platform ({0}) is "
885 "the host platform and is always connected.",
889 "Platform::ConnectRemote() is not supported by {0}", GetPluginName());
893 Status Platform::DisconnectRemote() {
897 "The currently selected platform ({0}) is "
898 "the host platform and is always connected.",
902 "Platform::DisconnectRemote() is not supported by {0}",
907 bool Platform::GetProcessInfo(lldb::pid_t pid,
916 uint32_t Platform::FindProcesses(const ProcessInstanceInfoMatch &match_info,
926 ProcessInstanceInfoList Platform::GetAllProcesses() {
934 Status Platform::LaunchProcess(ProcessLaunchInfo &launch_info) {
936 Log *log = GetLog(LLDBLog::Platform);
937 LLDB_LOGF(log, "Platform::%s()", __FUNCTION__);
953 "Platform::%s GetResumeCountForLaunchInfo() returned %" PRIu32
973 LLDB_LOGF(log, "Platform::%s final launch_info resume count: %" PRIu32,
979 "base lldb_private::Platform class can't launch remote processes");
983 Status Platform::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
987 "base lldb_private::Platform class can't expand arguments");
990 Status Platform::KillProcess(const lldb::pid_t pid) {
991 Log *log = GetLog(LLDBLog::Platform);
992 LLDB_LOGF(log, "Platform::%s, pid %" PRIu64, __FUNCTION__, pid);
996 "base lldb_private::Platform class can't kill remote processes");
1002 lldb::ProcessSP Platform::DebugProcess(ProcessLaunchInfo &launch_info,
1005 Log *log = GetLog(LLDBLog::Platform);
1031 "Platform::%s() StructuredDataPlugin launch "
1042 "Platform::%s LaunchProcess() call succeeded (pid=%" PRIu64 ")",
1067 LLDB_LOGF(log, "Platform::%s Attach() failed: %s", __FUNCTION__,
1072 "Platform::%s LaunchProcess() returned launch_info with "
1077 LLDB_LOGF(log, "Platform::%s LaunchProcess() failed: %s", __FUNCTION__,
1085 Platform::CreateArchList(llvm::ArrayRef<llvm::Triple::ArchType> archs,
1097 /// Lets a platform answer if it is compatible with a given
1099 bool Platform::IsCompatibleArchitecture(const ArchSpec &arch,
1120 Status Platform::PutFile(const FileSpec &source, const FileSpec &destination,
1122 Log *log = GetLog(LLDBLog::Platform);
1206 Status Platform::GetFile(const FileSpec &source, const FileSpec &destination) {
1211 Platform::CreateSymlink(const FileSpec &src, // The name of the link is in src
1219 bool Platform::GetFileExists(const lldb_private::FileSpec &file_spec) {
1225 Status Platform::Unlink(const FileSpec &path) {
1231 MmapArgList Platform::GetMmapArgumentList(const ArchSpec &arch, addr_t addr,
1245 lldb_private::Status Platform::RunShellCommand(
1259 lldb_private::Status Platform::RunShellCommand(
1275 "unable to run a remote command without a platform");
1279 Platform::CalculateMD5(const FileSpec &file_spec) {
1285 void Platform::SetLocalCacheDirectory(const char *local) {
1289 const char *Platform::GetLocalCacheDirectory() {
1298 "Platform-specific options required for rsync to work."},
1301 "Platform-specific rsync prefix put before the remote path."},
1313 "Platform-specific options required for SSH to work."},
1367 Platform::SetThreadCreationBreakpoint(lldb_private::Target &target) {
1433 Environment Platform::GetEnvironment() {
1439 const std::vector<ConstString> &Platform::GetTrapHandlerSymbolNames() {
1451 Platform::GetCachedExecutable(ModuleSpec &module_spec,
1458 return Platform::ResolveExecutable(spec, module_sp,
1470 Status Platform::GetRemoteSharedModule(const ModuleSpec &module_spec,
1494 // No valid architecture was specified, ask the platform for the
1537 // to bypass pulling files from remote platform, or to search symbol files
1593 void Platform::CallLocateModuleCallbackIfSet(const ModuleSpec &module_spec,
1607 Log *log = GetLog(LLDBLog::Platform);
1699 bool Platform::GetCachedSharedModule(const ModuleSpec &module_spec,
1706 Log *log = GetLog(LLDBLog::Platform);
1726 LLDB_LOGF(log, "Platform::%s - module %s not found in local cache: %s",
1732 Status Platform::DownloadModuleSlice(const FileSpec &src_file_spec,
1780 Status Platform::DownloadSymbolFile(const lldb::ModuleSP &module_sp,
1783 "Symbol file downloading not supported by the default platform.");
1786 FileSpec Platform::GetModuleCacheRoot() {
1792 const char *Platform::GetCacheHostname() { return GetHostname(); }
1794 const UnixSignalsSP &Platform::GetRemoteUnixSignals() {
1799 UnixSignalsSP Platform::GetUnixSignals() {
1805 uint32_t Platform::LoadImage(lldb_private::Process *process,
1843 uint32_t Platform::DoLoadImage(lldb_private::Process *process,
1849 "LoadImage is not supported on the current platform");
1853 uint32_t Platform::LoadImageUsingPaths(lldb_private::Process *process,
1870 Status Platform::UnloadImage(lldb_private::Process *process,
1873 "UnloadImage is not supported on the current platform");
1876 lldb::ProcessSP Platform::ConnectProcess(llvm::StringRef connect_url,
1884 lldb::ProcessSP Platform::ConnectProcessSynchronous(
1891 lldb::ProcessSP Platform::DoConnectProcess(llvm::StringRef connect_url,
1948 size_t Platform::ConnectToWaitingProcesses(lldb_private::Debugger &debugger,
1954 size_t Platform::GetSoftwareBreakpointTrapOpcode(Target &target,
2091 CompilerType Platform::GetSiginfoType(const llvm::Triple& triple) {
2095 Args Platform::GetExtraStartupCommands() {
2099 void Platform::SetLocateModuleCallback(LocateModuleCallback callback) {
2103 Platform::LocateModuleCallback Platform::GetLocateModuleCallback() const {
2137 // First try exact arch matches across all platform plug-ins
2150 // Next try compatible arch matches across all platform plug-ins
2185 PlatformSP host_platform_sp = Platform::GetHostPlatform();
2187 // Prefer the selected platform if it matches at least one architecture.
2196 // Prefer the host platform if it matches at least one architecture.
2207 if (PlatformSP platform = GetOrCreate(arch, process_host_arch, nullptr))
2208 candidates.push_back(platform);
2211 // The selected or host platform didn't match any of the architectures. If
2212 // the same platform supports all architectures then that's the obvious next
2230 PlatformSP platform_sp = Platform::Create(name);