[PATCH] D47609: [lldb, process] Fix occasional hang when launching a process in LLDB

Stella Stamenova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 1 12:19:17 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL333781: [lldb, process] Fix occasional hang when launching a process in LLDB (authored by stella.stamenova, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D47609?vs=149513&id=149529#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D47609

Files:
  lldb/trunk/include/lldb/lldb-enumerations.h
  lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
  lldb/trunk/source/Target/Process.cpp


Index: lldb/trunk/include/lldb/lldb-enumerations.h
===================================================================
--- lldb/trunk/include/lldb/lldb-enumerations.h
+++ lldb/trunk/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: lldb/trunk/source/Target/Process.cpp
===================================================================
--- lldb/trunk/source/Target/Process.cpp
+++ lldb/trunk/source/Target/Process.cpp
@@ -2688,8 +2688,7 @@
 Process::WaitForProcessStopPrivate(EventSP &event_sp,
                                    const Timeout<std::micro> &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) {
Index: lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
+++ lldb/trunk/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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47609.149529.patch
Type: text/x-patch
Size: 2496 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180601/9317bc94/attachment.bin>


More information about the llvm-commits mailing list