[Lldb-commits] [lldb] r219213 - Fix spurious output to command line when launching a process on Linux.

Todd Fiala todd.fiala at gmail.com
Tue Oct 7 09:05:22 PDT 2014


Author: tfiala
Date: Tue Oct  7 11:05:21 2014
New Revision: 219213

URL: http://llvm.org/viewvc/llvm-project?rev=219213&view=rev
Log:
Fix spurious output to command line when launching a process on Linux.

See http://reviews.llvm.org/D5632 for details.

Change by Shawn Best.

Modified:
    lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=219213&r1=219212&r2=219213&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue Oct  7 11:05:21 2014
@@ -2838,9 +2838,12 @@ Process::Launch (ProcessLaunchInfo &laun
                             system_runtime->DidLaunch();
 
                         m_os_ap.reset (OperatingSystem::FindPlugin (this, NULL));
-                        // This delays passing the stopped event to listeners till DidLaunch gets
-                        // a chance to complete...
-                        HandlePrivateEvent (event_sp);
+
+                        // Note, the stop event was consumed above, but not handled. This was done
+                        // to give DidLaunch a chance to run. The target is either stopped or crashed.
+                        // Directly set the state.  This is done to prevent a stop message with a bunch
+                        // of spurious output on thread status, as well as not pop a ProcessIOHandler.
+                        SetPublicState(state, false);
 
                         if (PrivateStateThreadIsValid ())
                             ResumePrivateStateThread ();
@@ -4029,7 +4032,8 @@ Process::HandlePrivateEvent (EventSP &ev
         {
             // Only push the input handler if we aren't fowarding events,
             // as this means the curses GUI is in use...
-            if (!GetTarget().GetDebugger().IsForwardingEvents())
+            // Or don't push it if we are launching since it will come up stopped.
+            if (!GetTarget().GetDebugger().IsForwardingEvents() && new_state != eStateLaunching)
                 PushProcessIOHandler ();
             m_iohandler_sync.SetValue(true, eBroadcastAlways);
         }





More information about the lldb-commits mailing list