[Lldb-commits] [lldb] r154524 - in /lldb/branches/lldb-platform-work/source: Commands/CommandObjectPlatform.cpp Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
Enrico Granata
egranata at apple.com
Wed Apr 11 12:35:36 PDT 2012
Author: enrico
Date: Wed Apr 11 14:35:36 2012
New Revision: 154524
URL: http://llvm.org/viewvc/llvm-project?rev=154524&view=rev
Log:
Moving the file I/O commands to 'platform file' subcommands. get-file and put-file are still in the top-level platform command. the basic primitives are now accessible in debug builds as platform file open,read,write,close. Enabling remote OSX attach to work by making PlatformRemoteGDBServer::ResolveExecutable() return no error - of course, the current implementation is just a stub
Modified:
lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp
lldb/branches/lldb-platform-work/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.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=154524&r1=154523&r2=154524&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp Wed Apr 11 14:35:36 2012
@@ -307,7 +307,7 @@
public:
CommandObjectPlatformFOpen (CommandInterpreter &interpreter) :
CommandObject (interpreter,
- "platform fopen",
+ "platform file open",
"Open a file on the remote end.",
NULL,
0)
@@ -352,7 +352,7 @@
public:
CommandObjectPlatformFClose (CommandInterpreter &interpreter) :
CommandObject (interpreter,
- "platform fclose",
+ "platform file close",
"Close a file on the remote end.",
NULL,
0)
@@ -394,7 +394,7 @@
public:
CommandObjectPlatformFRead (CommandInterpreter &interpreter) :
CommandObject (interpreter,
- "platform fread",
+ "platform file read",
"Read data from a file on the remote end.",
NULL,
0),
@@ -519,7 +519,7 @@
public:
CommandObjectPlatformFWrite (CommandInterpreter &interpreter) :
CommandObject (interpreter,
- "platform fwrite",
+ "platform file write",
"Write data to a file on the remote end.",
NULL,
0),
@@ -1493,6 +1493,37 @@
DISALLOW_COPY_AND_ASSIGN (CommandObjectPlatformProcess);
};
+class CommandObjectPlatformFile : public CommandObjectMultiword
+{
+public:
+ //------------------------------------------------------------------
+ // Constructors and Destructors
+ //------------------------------------------------------------------
+ CommandObjectPlatformFile (CommandInterpreter &interpreter) :
+ CommandObjectMultiword (interpreter,
+ "platform file",
+ "A set of commands to manage file access through a platform",
+ "platform process [attach|launch|list] ...")
+ {
+ LoadSubCommand ("open", CommandObjectSP (new CommandObjectPlatformFOpen (interpreter)));
+ LoadSubCommand ("close", CommandObjectSP (new CommandObjectPlatformFClose (interpreter)));
+ LoadSubCommand ("read", CommandObjectSP (new CommandObjectPlatformFRead (interpreter)));
+ LoadSubCommand ("write", CommandObjectSP (new CommandObjectPlatformFWrite (interpreter)));
+
+ }
+
+ virtual
+ ~CommandObjectPlatformFile ()
+ {
+ }
+
+private:
+ //------------------------------------------------------------------
+ // For CommandObjectPlatform only
+ //------------------------------------------------------------------
+ DISALLOW_COPY_AND_ASSIGN (CommandObjectPlatformFile);
+};
+
//----------------------------------------------------------------------
// CommandObjectPlatform constructor
//----------------------------------------------------------------------
@@ -1511,10 +1542,7 @@
#ifdef LLDB_CONFIGURATION_DEBUG
LoadSubCommand ("shell", CommandObjectSP (new CommandObjectPlatformShell (interpreter)));
LoadSubCommand ("mkdir", CommandObjectSP (new CommandObjectPlatformMkDir (interpreter)));
- LoadSubCommand ("fopen", CommandObjectSP (new CommandObjectPlatformFOpen (interpreter)));
- LoadSubCommand ("fclose", CommandObjectSP (new CommandObjectPlatformFClose (interpreter)));
- LoadSubCommand ("fread", CommandObjectSP (new CommandObjectPlatformFRead (interpreter)));
- LoadSubCommand ("fwrite", CommandObjectSP (new CommandObjectPlatformFWrite (interpreter)));
+ LoadSubCommand ("file", CommandObjectSP (new CommandObjectPlatformFile (interpreter)));
LoadSubCommand ("get-file", CommandObjectSP (new CommandObjectPlatformGetFile (interpreter)));
LoadSubCommand ("get-size", CommandObjectSP (new CommandObjectPlatformGetSize (interpreter)));
LoadSubCommand ("put-file", CommandObjectSP (new CommandObjectPlatformPutFile (interpreter)));
Modified: lldb/branches/lldb-platform-work/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp?rev=154524&r1=154523&r2=154524&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp Wed Apr 11 14:35:36 2012
@@ -96,7 +96,7 @@
const FileSpecList *module_search_paths_ptr)
{
Error error;
- error.SetErrorString ("PlatformRemoteGDBServer::ResolveExecutable() is unimplemented");
+ //error.SetErrorString ("PlatformRemoteGDBServer::ResolveExecutable() is unimplemented");
return error;
}
More information about the lldb-commits
mailing list