Lines Matching +full:remote +full:- +full:pid
1 //===-- CommandObjectPlatform.cpp -----------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
39 return (mode_t)(-1);
88 if (perms == (mode_t)-1)
145 // "platform select <platform-name>"
152 "platform select <platform-name>", 0),
154 false) // Don't include the "--platform" option by passing false
184 platform_sp->GetStatus(result.GetOutputStream());
218 ostrm.Format("{0}: {1}\n", host_platform_sp->GetPluginName(),
219 host_platform_sp->GetDescription());
256 platform_sp = target->GetPlatform();
262 platform_sp->GetStatus(ostrm);
270 // "platform connect <connect-url>"
277 "platform connect <connect-url>", 0) {
290 Status error(platform_sp->ConnectRemote(args));
292 platform_sp->GetStatus(ostrm);
295 platform_sp->ConnectToWaitingProcesses(GetDebugger(), error);
312 m_platform_options = platform_sp->GetConnectionOptions(m_interpreter);
313 if (m_platform_options != nullptr && !m_platform_options->m_did_finalize)
314 m_platform_options->Finalize();
338 if (platform_sp->IsConnected()) {
341 const char *hostname_cstr = platform_sp->GetHostname();
346 error = platform_sp->DisconnectRemote();
351 platform_sp->GetPluginName());
361 platform_sp->GetPluginName());
381 m_option_working_dir(LLDB_OPT_SET_1, false, "working-dir", 'w',
395 platform_sp->SetWorkingDirectory(
417 "Make a new directory on the remote end.", nullptr,
434 mode = options_permissions->m_permissions;
438 Status error = platform_sp->MakeDirectory(FileSpec(cmd_line), mode);
466 "Open a file on the remote end.", nullptr, 0) {
483 perms = options_permissions->m_permissions;
487 lldb::user_id_t fd = platform_sp->OpenFile(
519 "Close a file on the remote end.", nullptr, 0) {
538 bool success = platform_sp->CloseFile(fd, error);
560 "Read data from a file on the remote end.", nullptr,
581 uint64_t retcode = platform_sp->ReadFile(
654 "Write data to a file on the remote end.", nullptr,
675 platform_sp->WriteFile(fd, m_options.m_offset, &m_options.m_data[0],
763 // "platform get-file remote-file-path host-file-path"
768 interpreter, "platform get-file",
769 "Transfer a file from the remote end to the local host.",
770 "platform get-file <remote-file-spec> <local-file-spec>", 0) {
774 (lldb) platform get-file /the/remote/file/path /the/local/file/path
776 Transfer a file from the remote end with file path /the/remote/file/path to the local host.)");
828 Status error = platform_sp->GetFile(FileSpec(remote_file_path),
832 "successfully get-file from %s (remote) to %s (host)\n",
836 result.AppendMessageWithFormat("get-file failed: %s\n",
845 // "platform get-size remote-file-path"
849 : CommandObjectParsed(interpreter, "platform get-size",
850 "Get the file size from the remote end.",
851 "platform get-size <remote-file-spec>", 0) {
855 (lldb) platform get-size /the/remote/file/path
857 Get the file size from the remote end with path /the/remote/file/path.)");
876 user_id_t size = platform_sp->GetFileSize(FileSpec(remote_file_path));
878 result.AppendMessageWithFormat("File size of %s (remote): %" PRIu64
884 "Error getting file size of %s (remote)\n",
893 // "platform get-permissions remote-file-path"
897 : CommandObjectParsed(interpreter, "platform get-permissions",
898 "Get the file permission bits from the remote end.",
899 "platform get-permissions <remote-file-spec>", 0) {
903 (lldb) platform get-permissions /the/remote/file/path
905 Get the file permissions from the remote end with path /the/remote/file/path.)");
925 Status error = platform_sp->GetFilePermissions(FileSpec(remote_file_path),
929 "File permissions of %s (remote): 0o%04" PRIo32 "\n",
940 // "platform file-exists remote-file-path"
944 : CommandObjectParsed(interpreter, "platform file-exists",
945 "Check if the file exists on the remote end.",
946 "platform file-exists <remote-file-spec>", 0) {
950 (lldb) platform file-exists /the/remote/file/path
952 Check if /the/remote/file/path exists on the remote end.)");
971 bool exists = platform_sp->GetFileExists(FileSpec(remote_file_path));
973 "File %s (remote) %s\n",
982 // "platform put-file"
987 interpreter, "platform put-file",
988 "Transfer a file from this system to the remote end.",
989 "platform put-file <source> [<destination>]", 0) {
993 (lldb) platform put-file /source/foo.txt /destination/bar.txt
995 (lldb) platform put-file /source/foo.txt
1031 Status error(platform_sp->PutFile(src_fs, dst_fs));
1048 "Launch a new process on a remote platform.",
1063 // this on the remote system we should use the remote completer.
1078 platform_sp = target->GetPlatform();
1088 Module *exe_module = target->GetExecutableModulePointer();
1090 m_options.launch_info.GetExecutableFile() = exe_module->GetFileSpec();
1095 m_options.launch_info.GetArchitecture() = exe_module->GetArchitecture();
1103 target->SetProcessLaunchInfo(m_options.launch_info);
1123 // If no arguments were given to the command, use target.run-args.
1125 target->GetRunArguments(target_run_args);
1129 ProcessSP process_sp(platform_sp->DebugProcess(
1148 StateType state = process_sp->WaitForProcessToStop(
1151 process_sp->RestoreProcessEvents();
1155 process_sp->BroadcastEvent(first_stop_event_sp);
1164 // Now we have handled the stop-from-attach, and we are just
1167 process_sp->ResumeSynchronous(&result.GetOutputStream());
1169 error = process_sp->Resume();
1184 if (process_sp && process_sp->IsAlive()) {
1214 "List processes on a remote platform by name, pid, "
1227 platform_sp = target->GetPlatform();
1238 lldb::pid_t pid = m_options.match_info.GetProcessInfo().GetProcessID();
1239 if (pid != LLDB_INVALID_PROCESS_ID) {
1241 if (platform_sp->GetProcessInfo(pid, proc_info)) {
1244 proc_info.DumpAsTableRow(ostrm, platform_sp->GetUserIDResolver(),
1249 "no process found with pid = %" PRIu64 "\n", pid);
1254 platform_sp->FindProcesses(m_options.match_info, proc_infos);
1285 match_desc, match_name, platform_sp->GetName());
1289 platform_sp->GetName());
1293 matches > 1 ? "es were" : " was", platform_sp->GetName());
1302 ostrm, platform_sp->GetUserIDResolver(), m_options.show_args,
1377 execution_context ? execution_context->GetTargetSP() : TargetSP();
1379 target_sp ? target_sp->GetDebugger().shared_from_this()
1382 debugger_sp ? debugger_sp->GetPlatformList().GetSelectedPlatform()
1464 "platform process info <pid> [<pid> <pid> ...]", 0) {
1475 platform_sp = target->GetPlatform();
1486 if (platform_sp->IsConnected()) {
1489 lldb::pid_t pid;
1490 if (entry.ref().getAsInteger(0, pid)) {
1496 if (platform_sp->GetProcessInfo(pid, proc_info)) {
1498 pid);
1499 proc_info.Dump(ostrm, platform_sp->GetUserIDResolver());
1503 pid);
1511 platform_sp->GetPluginName());
1531 "platform process attach <cmd-options>"),
1554 ProcessSP remote_process_sp = platform_sp->Attach(
1642 "missing shell interpreter path for option -i|--interpreter.");
1670 "platform shell <shell-command>", 0) {
1685 result.GetOutputStream().Printf("%s\n", this->GetSyntax().str().c_str());
1697 result.GetOutputStream().Printf("%s <shell-command>\n",
1712 int status = -1;
1713 int signo = -1;
1714 error = (platform_sp->RunShellCommand(m_options.m_shell_interpreter, cmd,
1736 "error: cannot run remote shell commands without a platform\n");
1738 "error: cannot run remote shell commands without a platform");
1751 // "platform install" - install a target to a remote end
1756 interpreter, "platform target-install",
1757 "Install a target (bundle or executable file) to the remote end.",
1758 "platform target-install <local-thing> <remote-sandbox>", 0) {
1778 result.AppendError("platform target-install takes two arguments");
1796 Status error = platform_sp->Install(src, dst);
1826 LoadSubCommand("file-exists",
1828 LoadSubCommand("get-file", CommandObjectSP(new CommandObjectPlatformGetFile(
1830 LoadSubCommand("get-permissions",
1832 LoadSubCommand("get-size", CommandObjectSP(new CommandObjectPlatformGetSize(
1834 LoadSubCommand("put-file", CommandObjectSP(new CommandObjectPlatformPutFile(
1841 "target-install",