diff options
Diffstat (limited to 'lldb/source/Commands/CommandObjectPlatform.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectPlatform.cpp | 75 |
1 files changed, 18 insertions, 57 deletions
diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp index 790f1db..b25c391 100644 --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -418,7 +418,7 @@ public: : CommandObjectParsed(interpreter, "platform mkdir", "Make a new directory on the remote end.", nullptr, 0) { - CommandArgumentData thread_arg{eArgTypePath, eArgRepeatPlain}; + CommandArgumentData thread_arg{eArgTypeRemotePath, eArgRepeatPlain}; m_arguments.push_back({thread_arg}); } @@ -467,21 +467,12 @@ public: CommandObjectPlatformFOpen(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "platform file open", "Open a file on the remote end.", nullptr, 0) { - CommandArgumentData path_arg{eArgTypePath, eArgRepeatPlain}; + CommandArgumentData path_arg{eArgTypeRemotePath, eArgRepeatPlain}; m_arguments.push_back({path_arg}); } ~CommandObjectPlatformFOpen() override = default; - void - HandleArgumentCompletion(CompletionRequest &request, - OptionElementVector &opt_element_vector) override { - if (request.GetCursorIndex() == 0) - lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), lldb::eRemoteDiskFileCompletion, request, - nullptr); - } - void DoExecute(Args &args, CommandReturnObject &result) override { PlatformSP platform_sp( GetDebugger().GetPlatformList().GetSelectedPlatform()); @@ -795,7 +786,7 @@ public: CommandArgumentData file_arg_remote, file_arg_host; // Define the first (and only) variant of this arg. - file_arg_remote.arg_type = eArgTypeFilename; + file_arg_remote.arg_type = eArgTypeRemoteFilename; file_arg_remote.arg_repetition = eArgRepeatPlain; // There is only one variant this argument could be; put it into the // argument entry. @@ -876,7 +867,7 @@ public: CommandArgumentData file_arg_remote; // Define the first (and only) variant of this arg. - file_arg_remote.arg_type = eArgTypeFilename; + file_arg_remote.arg_type = eArgTypeRemoteFilename; file_arg_remote.arg_repetition = eArgRepeatPlain; // There is only one variant this argument could be; put it into the // argument entry. @@ -888,17 +879,6 @@ public: ~CommandObjectPlatformGetSize() override = default; - void - HandleArgumentCompletion(CompletionRequest &request, - OptionElementVector &opt_element_vector) override { - if (request.GetCursorIndex() != 0) - return; - - lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), lldb::eRemoteDiskFileCompletion, request, - nullptr); - } - void DoExecute(Args &args, CommandReturnObject &result) override { // If the number of arguments is incorrect, issue an error message. if (args.GetArgumentCount() != 1) { @@ -946,7 +926,7 @@ public: CommandArgumentData file_arg_remote; // Define the first (and only) variant of this arg. - file_arg_remote.arg_type = eArgTypeFilename; + file_arg_remote.arg_type = eArgTypeRemoteFilename; file_arg_remote.arg_repetition = eArgRepeatPlain; // There is only one variant this argument could be; put it into the // argument entry. @@ -958,17 +938,6 @@ public: ~CommandObjectPlatformGetPermissions() override = default; - void - HandleArgumentCompletion(CompletionRequest &request, - OptionElementVector &opt_element_vector) override { - if (request.GetCursorIndex() != 0) - return; - - lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), lldb::eRemoteDiskFileCompletion, request, - nullptr); - } - void DoExecute(Args &args, CommandReturnObject &result) override { // If the number of arguments is incorrect, issue an error message. if (args.GetArgumentCount() != 1) { @@ -1015,7 +984,7 @@ public: CommandArgumentData file_arg_remote; // Define the first (and only) variant of this arg. - file_arg_remote.arg_type = eArgTypeFilename; + file_arg_remote.arg_type = eArgTypeRemoteFilename; file_arg_remote.arg_repetition = eArgRepeatPlain; // There is only one variant this argument could be; put it into the // argument entry. @@ -1027,17 +996,6 @@ public: ~CommandObjectPlatformFileExists() override = default; - void - HandleArgumentCompletion(CompletionRequest &request, - OptionElementVector &opt_element_vector) override { - if (request.GetCursorIndex() != 0) - return; - - lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), lldb::eRemoteDiskFileCompletion, request, - nullptr); - } - void DoExecute(Args &args, CommandReturnObject &result) override { // If the number of arguments is incorrect, issue an error message. if (args.GetArgumentCount() != 1) { @@ -1080,7 +1038,7 @@ public: Omitting the destination places the file in the platform working directory.)"); CommandArgumentData source_arg{eArgTypePath, eArgRepeatPlain}; - CommandArgumentData path_arg{eArgTypePath, eArgRepeatOptional}; + CommandArgumentData path_arg{eArgTypeRemotePath, eArgRepeatOptional}; m_arguments.push_back({source_arg}); m_arguments.push_back({path_arg}); } @@ -1139,6 +1097,16 @@ public: m_arguments.push_back({run_arg_arg}); } + void + HandleArgumentCompletion(CompletionRequest &request, + OptionElementVector &opt_element_vector) override { + // I didn't make a type for RemoteRunArgs, but since we're going to run + // this on the remote system we should use the remote completer. + lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), lldb::eRemoteDiskFileCompletion, request, + nullptr); + } + ~CommandObjectPlatformProcessLaunch() override = default; Options *GetOptions() override { return &m_all_options; } @@ -1552,13 +1520,6 @@ public: ~CommandObjectPlatformProcessInfo() override = default; - void - HandleArgumentCompletion(CompletionRequest &request, - OptionElementVector &opt_element_vector) override { - lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), lldb::eProcessIDCompletion, request, nullptr); - } - protected: void DoExecute(Args &args, CommandReturnObject &result) override { Target *target = GetDebugger().GetSelectedTarget().get(); @@ -1850,7 +1811,7 @@ public: "Install a target (bundle or executable file) to the remote end.", "platform target-install <local-thing> <remote-sandbox>", 0) { CommandArgumentData local_arg{eArgTypePath, eArgRepeatPlain}; - CommandArgumentData remote_arg{eArgTypePath, eArgRepeatPlain}; + CommandArgumentData remote_arg{eArgTypeRemotePath, eArgRepeatPlain}; m_arguments.push_back({local_arg}); m_arguments.push_back({remote_arg}); } |