Merge lldb-platform and lldb-gdbserver into a single binary

This commit merges lldb-platform and lldb-gdbserver into a single binary
of the same size as each of the previous individual binaries. Execution
mode is controlled by the first argument being either platform or
gdbserver.

Patch from: flackr <flackr@google.com>

Differential revision: http://reviews.llvm.org/D7545

llvm-svn: 229683
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index ab27eb0..ecf581b 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -38,7 +38,7 @@
 #if defined(__APPLE__)
 # define DEBUGSERVER_BASENAME    "debugserver"
 #else
-# define DEBUGSERVER_BASENAME    "lldb-gdbserver"
+# define DEBUGSERVER_BASENAME    "lldb-server"
 #endif
 
 using namespace lldb;
@@ -739,10 +739,15 @@
         Args &debugserver_args = launch_info.GetArguments();
         debugserver_args.Clear();
         char arg_cstr[PATH_MAX];
-        
+
         // Start args with "debugserver /file/path -r --"
         debugserver_args.AppendArgument(debugserver_path);
 
+#if !defined(__APPLE__)
+        // First argument to lldb-server must be mode in which to run.
+        debugserver_args.AppendArgument("gdbserver");
+#endif
+
         // If a host and port is supplied then use it
         char host_and_port[128];
         if (hostname)