[Lldb-commits] [lldb] r218075 - llgs: removed some wait-for-stop code in inferior process launch pipeline.

Todd Fiala todd.fiala at gmail.com
Thu Sep 18 14:02:03 PDT 2014


Author: tfiala
Date: Thu Sep 18 16:02:03 2014
New Revision: 218075

URL: http://llvm.org/viewvc/llvm-project?rev=218075&view=rev
Log:
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.

Modified:
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=218075&r1=218074&r2=218075&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Thu Sep 18 16:02:03 2014
@@ -478,13 +478,13 @@ GDBRemoteCommunicationServer::LaunchProc
     // 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 @@ GDBRemoteCommunicationServer::LaunchDebu
     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;

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h?rev=218075&r1=218074&r2=218075&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h Thu Sep 18 16:02:03 2014
@@ -514,9 +514,9 @@ private:
         return !m_is_platform;
     }
 
-    /// Launch a process from lldb-gdbserver
+    /// Launch an inferior process from lldb-gdbserver
     lldb_private::Error
-    LaunchDebugServerProcess ();
+    LaunchProcessForDebugging ();
 
     /// Launch a process from lldb-platform
     lldb_private::Error





More information about the lldb-commits mailing list