Debugger: Don't wait for threads or user in the CLI input loop.
It seems to be unecessary and just hangs the CLI most of the time
if there's no thread about to stop.
Makes Debugger --team <team> actually work instead of just
hanging.
Diff
src/apps/debugger/user_interface/cli/CliContext.cpp | 20 +-------------------
src/apps/debugger/user_interface/cli/CliContext.h | 1 -
src/apps/debugger/user_interface/cli/CommandLineUserInterface.cpp | 5 -----
3 files changed, 1 insertion(+), 25 deletions(-)
@@ -382,24 +382,6 @@
void
CliContext::WaitForThreadOrUser()
{
AutoLocker<BLocker> locker(fLock);
while (fStoppedThread == NULL) {
_WaitForEvent(MSG_THREAD_STATE_CHANGED);
if (fTerminating)
break;
}
if (fCurrentThread == NULL)
SetCurrentThread(fStoppedThread);
}
void
CliContext::WaitForEvent(uint32 event)
{
AutoLocker<BLocker> locker(fLock);
@@ -442,7 +424,7 @@
break;
}
case MSG_THREAD_STACK_TRACE_CHANGED:
if (threadID == fCurrentThread->ID()) {
if (fCurrentThread != NULL && threadID == fCurrentThread->ID()) {
AutoLocker< ::Team> locker(fTeam);
::Thread* thread = fTeam->ThreadByID(threadID);
@@ -93,7 +93,6 @@
void QuitSession(bool killTeam);
void WaitForThreadOrUser();
void WaitForEvent(uint32 event);
private:
@@ -253,11 +253,6 @@
thread_id currentThread = -1;
while (!fTerminating) {
fContext->WaitForThreadOrUser();
if (fContext->IsTerminating())
break;
if (fContext->CurrentThreadID() != currentThread) {
fContext->PrintCurrentThread();