Make the "synchronous" mode actually work without race conditions.
There were many issues with synchronous mode that we discovered when started to try and add a "batch" mode. There was a race condition where the event handling thread might consume events when in sync mode and other times the Process::WaitForProcessToStop() would consume them. This also led to places where the Process IO handler might or might not get popped when it needed to be. llvm-svn: 220254
This commit is contained in:
@@ -710,15 +710,11 @@ SBThread::ResumeNewPlan (ExecutionContext &exe_ctx, ThreadPlan *new_plan)
|
||||
|
||||
// Why do we need to set the current thread by ID here???
|
||||
process->GetThreadList().SetSelectedThreadByID (thread->GetID());
|
||||
sb_error.ref() = process->Resume();
|
||||
|
||||
if (sb_error.Success())
|
||||
{
|
||||
// If we are doing synchronous mode, then wait for the
|
||||
// process to stop yet again!
|
||||
if (process->GetTarget().GetDebugger().GetAsyncExecution () == false)
|
||||
process->WaitForProcessToStop (NULL);
|
||||
}
|
||||
|
||||
if (process->GetTarget().GetDebugger().GetAsyncExecution ())
|
||||
sb_error.ref() = process->Resume ();
|
||||
else
|
||||
sb_error.ref() = process->ResumeSynchronous (NULL);
|
||||
|
||||
return sb_error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user