[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 11:14:24 PDT 2018
stella.stamenova updated this revision to Diff 149513.
Repository:
rL LLVM
https://reviews.llvm.org/D47609
Files:
include/lldb/lldb-enumerations.h
source/Plugins/Process/Windows/Common/ProcessWindows.cpp
source/Target/Process.cpp
Index: source/Target/Process.cpp
===================================================================
--- source/Target/Process.cpp
+++ 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: 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: 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47609.149513.patch
Type: text/x-patch
Size: 2397 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180601/37015501/attachment.bin>
More information about the llvm-commits
mailing list