From bea87e89d4a0160bf078ff02dea73440bab65f07 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 10 Feb 2005 03:03:53 +0000 Subject: [PATCH] Init and cleanup the team related debugging structure. Send the debugger a respective message, when the debugged team has been deleted. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11316 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/team.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/kernel/core/team.c b/src/kernel/core/team.c index 0c44a6a516..00ab094c57 100644 --- a/src/kernel/core/team.c +++ b/src/kernel/core/team.c @@ -8,6 +8,7 @@ /* Team functions */ +#include #include #include @@ -689,6 +690,8 @@ create_team_struct(const char *name, bool kernel) list_init(&team->image_list); + clear_team_debug_info(&team->debug_info); + if (arch_team_init_team_struct(team, kernel) < 0) goto error2; @@ -745,6 +748,13 @@ team_remove_team(struct team *team, struct process_group **_freeGroup) void team_delete_team(struct team *team) { + // if the team was being debugged, stop that now + team_id teamID = team->id; + port_id debuggerPort + = (team->debug_info.flags & B_TEAM_DEBUG_DEBUGGER_INSTALLED + ? team->debug_info.debugger_port : -1); + destroy_team_debug_info(&team->debug_info); + if (team->num_threads > 0) { // there are other threads still in this team, // cycle through and signal kill on each of the threads @@ -786,6 +796,15 @@ team_delete_team(struct team *team) vfs_free_io_context(team->io_context); free(team); + + // notify the debugger, that the team is gone + if (debuggerPort >= 0) { + debug_team_deleted message; + message.team = teamID; + write_port_etc(debuggerPort, B_DEBUGGER_MESSAGE_TEAM_DELETED, &message, + sizeof(message), B_RELATIVE_TIMEOUT, 0); + // ToDo: Would it be OK to wait here? + } }