[Lldb-commits] [lldb] r154358 - /lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp

Johnny Chen johnny.chen at apple.com
Mon Apr 9 16:57:11 PDT 2012


Author: johnny
Date: Mon Apr  9 18:57:11 2012
New Revision: 154358

URL: http://llvm.org/viewvc/llvm-project?rev=154358&view=rev
Log:
Add 'platform get-file' command to upload a file from the remote end into the local host.
http://llvm.org/viewvc/llvm-project?rev=154355&view=rev, which was supposed to be a merge from ToT, accidentally checked in some change related to this command.
Oops!

I still need to add real implementation for plugin PlatformMacOSX.cpp similar to PutFile().

Usage:

(lldb) help platform get-file
Examples: 

    platform get-file /the/remote/file/path /the/local/file/path
    # Upload a file from the remote end with file path /the/remote/file/path to the local host.

Syntax: platform get-file <filename> <filename>
(lldb)

Modified:
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp?rev=154358&r1=154357&r2=154358&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp Mon Apr  9 18:57:11 2012
@@ -640,10 +640,34 @@
     CommandObjectPlatformGetFile (CommandInterpreter &interpreter) :
     CommandObject (interpreter,
                    "platform get-file",
-                   "Get a file from the remote platform into the host platform.",
+                   "Upload a file from the remote end into the local host.",
                    NULL,
                    0)
     {
+        SetHelpLong(
+"Examples: \n\
+\n\
+    platform get-file /the/remote/file/path /the/local/file/path\n\
+    # Upload a file from the remote end with file path /the/remote/file/path to the local host.\n");
+
+        CommandArgumentEntry arg1, arg2;
+        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_repetition = eArgRepeatPlain;
+        // There is only one variant this argument could be; put it into the argument entry.
+        arg1.push_back (file_arg_remote);
+        
+        // Define the second (and only) variant of this arg.
+        file_arg_host.arg_type = eArgTypeFilename;
+        file_arg_host.arg_repetition = eArgRepeatPlain;
+        // There is only one variant this argument could be; put it into the argument entry.
+        arg2.push_back (file_arg_host);
+
+        // Push the data for the first and the second arguments into the m_arguments vector.
+        m_arguments.push_back (arg1);
+        m_arguments.push_back (arg2);
     }
     
     virtual





More information about the lldb-commits mailing list