llgs: removed some wait-for-stop code in inferior process launch pipeline.

The $A handler was unnecessarily waiting for the launched app to hit a stop
before returning.  Removed this code.

Renamed the llgs inferior launching code to LaunchProcessForDebugging ()
to prevent it from possibly being mistaken as code that lldb-platform uses
to launch a debugserver process.  We probably want to look at breaking out
llgs-specific and lldb-platform-specific code into separate derived classes,
with common code in a shared base class.

llvm-svn: 218075
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
index 1a48f59..b20a8ab 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -478,13 +478,13 @@
     // FIXME This looks an awful lot like we could override this in
     // derived classes, one for lldb-platform, the other for lldb-gdbserver.
     if (IsGdbServer ())
-        return LaunchDebugServerProcess ();
+        return LaunchProcessForDebugging ();
     else
         return LaunchPlatformProcess ();
 }
 
 lldb_private::Error
-GDBRemoteCommunicationServer::LaunchDebugServerProcess ()
+GDBRemoteCommunicationServer::LaunchProcessForDebugging ()
 {
     Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
 
@@ -530,33 +530,10 @@
     if ((pid = m_process_launch_info.GetProcessID ()) != LLDB_INVALID_PROCESS_ID)
     {
         // add to spawned pids
-        {
-            Mutex::Locker locker (m_spawned_pids_mutex);
-            // On an lldb-gdbserver, we would expect there to be only one.
-            assert (m_spawned_pids.empty () && "lldb-gdbserver adding tracked process but one already existed");
-            m_spawned_pids.insert (pid);
-        }
-    }
-
-    if (error.Success ())
-    {
-        if (log)
-            log->Printf ("GDBRemoteCommunicationServer::%s beginning check to wait for launched application to hit first stop", __FUNCTION__);
-
-        int iteration = 0;
-        // Wait for the process to hit its first stop state.
-        while (!StateIsStoppedState (m_debugged_process_sp->GetState (), false))
-        {
-            if (log)
-                log->Printf ("GDBRemoteCommunicationServer::%s waiting for launched process to hit first stop (%d)...", __FUNCTION__, iteration++);
-
-            // FIXME use a finer granularity.
-            std::this_thread::sleep_for(std::chrono::seconds(1));
-        }
-
-        if (log)
-            log->Printf ("GDBRemoteCommunicationServer::%s launched application has hit first stop", __FUNCTION__);
-
+        Mutex::Locker locker (m_spawned_pids_mutex);
+        // On an lldb-gdbserver, we would expect there to be only one.
+        assert (m_spawned_pids.empty () && "lldb-gdbserver adding tracked process but one already existed");
+        m_spawned_pids.insert (pid);
     }
 
     return error;