Implement support for catching rename and thread priority change events.
This lets us keep up to date with thread names, which makes, for example Tracker a bit more tolerable to debug since it employs thread renaming to set the names of its windows. Implements #4430. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39847 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -884,6 +884,25 @@ TeamDebugger::_HandleDebuggerMessage(DebugEvent* event)
|
||||
handled = _HandleThreadCreated(threadEvent);
|
||||
break;
|
||||
}
|
||||
case B_DEBUGGER_MESSAGE_THREAD_RENAMED:
|
||||
{
|
||||
ThreadRenamedEvent* threadEvent
|
||||
= dynamic_cast<ThreadRenamedEvent*>(event);
|
||||
TRACE_EVENTS("B_DEBUGGER_MESSAGE_THREAD_RENAMED: thread: %ld "
|
||||
"(\"%s\")\n",
|
||||
threadEvent->RenamedThread(), threadEvent->NewName());
|
||||
handled = _HandleThreadRenamed(threadEvent);
|
||||
break;
|
||||
}
|
||||
case B_DEBUGGER_MESSAGE_THREAD_PRIORITY_CHANGED:
|
||||
{
|
||||
ThreadPriorityChangedEvent* threadEvent
|
||||
= dynamic_cast<ThreadPriorityChangedEvent*>(event);
|
||||
TRACE_EVENTS("B_DEBUGGER_MESSAGE_THREAD_PRIORITY_CHANGED: thread:"
|
||||
" %ld\n", threadEvent->ChangedThread());
|
||||
handled = _HandleThreadPriorityChanged(threadEvent);
|
||||
break;
|
||||
}
|
||||
case B_DEBUGGER_MESSAGE_THREAD_DELETED:
|
||||
TRACE_EVENTS("B_DEBUGGER_MESSAGE_THREAD_DELETED: thread: %ld\n",
|
||||
event->Thread());
|
||||
@@ -953,6 +972,29 @@ TeamDebugger::_HandleThreadCreated(ThreadCreatedEvent* event)
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
TeamDebugger::_HandleThreadRenamed(ThreadRenamedEvent* event)
|
||||
{
|
||||
AutoLocker< ::Team> locker(fTeam);
|
||||
|
||||
::Thread* thread = fTeam->ThreadByID(event->RenamedThread());
|
||||
|
||||
if (thread != NULL)
|
||||
thread->SetName(event->NewName());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
TeamDebugger::_HandleThreadPriorityChanged(ThreadPriorityChangedEvent*)
|
||||
{
|
||||
// TODO: implement once we actually track thread priorities
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
TeamDebugger::_HandleThreadDeleted(ThreadDeletedEvent* event)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user