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.
This commit is contained in:
@@ -906,10 +906,7 @@ ThreadHandler::_HandleBreakpointConditionIfNeeded(CpuState* cpuState)
|
||||
BPrivate::ObjectDeleter<ExpressionEvaluationListener> 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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user