Index: include/lldb/lldb-enumerations.h =================================================================== --- include/lldb/lldb-enumerations.h +++ include/lldb/lldb-enumerations.h @@ -44,6 +44,9 @@ ///launched or attached to anything yet eStateAttaching, ///< Process is currently trying to attach eStateLaunching, ///< Process is in the process of launching + // The state changes eStateAttaching and eStateLaunching are both sent while the + // private state thread is either not yet started or paused. For that reason, they + // should only be signaled as public state changes, and not private state changes. eStateStopped, ///< Process or thread is stopped and can be examined. eStateRunning, ///< Process or thread is running and can't be examined. eStateStepping, ///< Process or thread is in the process of stepping and can Index: source/Plugins/Process/Windows/Common/ProcessWindows.cpp =================================================================== --- source/Plugins/Process/Windows/Common/ProcessWindows.cpp +++ source/Plugins/Process/Windows/Common/ProcessWindows.cpp @@ -249,7 +249,6 @@ bool stop_at_entry = launch_info.GetFlags().Test(eLaunchFlagStopAtEntry); m_session_data.reset(new ProcessWindowsData(stop_at_entry)); - SetPrivateState(eStateLaunching); DebugDelegateSP delegate(new LocalDebugDelegate(shared_from_this())); m_session_data->m_debugger.reset(new DebuggerThread(delegate)); DebuggerThreadSP debugger = m_session_data->m_debugger; Index: source/Target/Process.cpp =================================================================== --- source/Target/Process.cpp +++ source/Target/Process.cpp @@ -2688,8 +2688,7 @@ Process::WaitForProcessStopPrivate(EventSP &event_sp, const Timeout &timeout) { StateType state; - // Now wait for the process to launch and return control to us, and then call - // DidLaunch: + while (true) { event_sp.reset(); state = GetStateChangedEventsPrivate(event_sp, timeout); @@ -2767,6 +2766,9 @@ } } else { EventSP event_sp; + + // Now wait for the process to launch and return control to us, and then call + // DidLaunch: StateType state = WaitForProcessStopPrivate(event_sp, seconds(10)); if (state == eStateInvalid || !event_sp) {