Handle team deletion debug event.

When the target team exits, notify the user and shut down the debugger.
This commit is contained in:
Rene Gollent 2013-04-23 23:05:36 -04:00
parent 8b49cb7645
commit dd817ff93c
2 changed files with 21 additions and 1 deletions

View File

@ -1145,10 +1145,14 @@ TeamDebugger::_HandleDebuggerMessage(DebugEvent* event)
//printf("B_DEBUGGER_MESSAGE_TEAM_CREATED: team: %ld\n", message.team_created.new_team);
// break;
case B_DEBUGGER_MESSAGE_TEAM_DELETED:
// TODO: Handle!
{
TRACE_EVENTS("B_DEBUGGER_MESSAGE_TEAM_DELETED: team: %" B_PRId32
"\n", event->Team());
TeamDeletedEvent* teamEvent
= dynamic_cast<TeamDeletedEvent*>(event);
handled = _HandleTeamDeleted(teamEvent);
break;
}
case B_DEBUGGER_MESSAGE_TEAM_EXEC:
TRACE_EVENTS("B_DEBUGGER_MESSAGE_TEAM_EXEC: team: %" B_PRId32 "\n",
event->Team());
@ -1226,6 +1230,20 @@ TeamDebugger::_HandleDebuggerMessage(DebugEvent* event)
}
bool
TeamDebugger::_HandleTeamDeleted(TeamDeletedEvent* event)
{
char message[64];
snprintf(message, sizeof(message), "Team %" B_PRId32 " has terminated.",
event->Team());
fUserInterface->SynchronouslyAskUser("Quit Debugger", message, "Quit",
NULL, NULL);
PostMessage(B_QUIT_REQUESTED);
return true;
}
bool
TeamDebugger::_HandleThreadCreated(ThreadCreatedEvent* event)
{

View File

@ -116,6 +116,8 @@ private:
void _HandleDebuggerMessage(DebugEvent* event);
bool _HandleTeamDeleted(
TeamDeletedEvent* event);
bool _HandleThreadCreated(
ThreadCreatedEvent* event);
bool _HandleThreadRenamed(