From 6e724034a3496e06bb4d99a1c6efc2aa6007782a Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sun, 28 Dec 2014 23:34:48 -0500 Subject: [PATCH] Debugger: ThreadHandler cleanup. - When evaluating a breakpoint condition, there's no need to change the thread state unless the condition is actually met. This would lead to lots of unnecessary state switching and associated overhead in the GUI. --- src/apps/debugger/controllers/ThreadHandler.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/apps/debugger/controllers/ThreadHandler.cpp b/src/apps/debugger/controllers/ThreadHandler.cpp index f513d71a89..8978d883a6 100644 --- a/src/apps/debugger/controllers/ThreadHandler.cpp +++ b/src/apps/debugger/controllers/ThreadHandler.cpp @@ -906,10 +906,7 @@ ThreadHandler::_HandleBreakpointConditionIfNeeded(CpuState* cpuState) BPrivate::ObjectDeleter deleter( listener); if (error == B_OK) { - _SetThreadState(THREAD_STATE_STOPPED, cpuState, - THREAD_STOPPED_BREAKPOINT, BString()); teamLocker.Unlock(); - do { error = acquire_sem(fConditionWaitSem); } while (error == B_INTERRUPTED); @@ -921,11 +918,11 @@ ThreadHandler::_HandleBreakpointConditionIfNeeded(CpuState* cpuState) fConditionResult->ReleaseReference(); fConditionResult = NULL; } + _SetThreadState(THREAD_STATE_STOPPED, cpuState, + THREAD_STOPPED_BREAKPOINT, BString()); return false; } else { - _SetThreadState(THREAD_STATE_RUNNING, NULL, - THREAD_STOPPED_UNKNOWN, BString()); - fDebuggerInterface->ContinueThread(fThread->ID()); + fDebuggerInterface->ContinueThread(ThreadID()); return true; } }