diff options
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r-- | lldb/source/Target/Process.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 3c9fea377e9..93159fcae99 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -1230,7 +1230,7 @@ Process::GetNextEvent (EventSP &event_sp) StateType -Process::WaitForProcessToStop (const TimeValue *timeout, lldb::EventSP *event_sp_ptr) +Process::WaitForProcessToStop (const TimeValue *timeout, lldb::EventSP *event_sp_ptr, bool wait_always) { // We can't just wait for a "stopped" event, because the stopped event may have restarted the target. // We have to actually check each event, and in the case of a stopped event check the restarted flag @@ -1243,6 +1243,19 @@ Process::WaitForProcessToStop (const TimeValue *timeout, lldb::EventSP *event_sp if (state == eStateDetached || state == eStateExited) return state; + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); + if (log) + log->Printf ("Process::%s (timeout = %p)", __FUNCTION__, timeout); + + if (!wait_always && + StateIsStoppedState(state, true) && + StateIsStoppedState(GetPrivateState(), true)) { + if (log) + log->Printf("Process::%s returning without waiting for events; process private and public states are already 'stopped'.", + __FUNCTION__); + return state; + } + while (state != eStateInvalid) { EventSP event_sp; |