diff --git a/headers/private/kernel/user_debugger.h b/headers/private/kernel/user_debugger.h index 5597fa5dea..dc95f36edf 100644 --- a/headers/private/kernel/user_debugger.h +++ b/headers/private/kernel/user_debugger.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2008, Ingo Weinhold, ingo_weinhold@gmx.de. + * Copyright 2005-2009, Ingo Weinhold, ingo_weinhold@gmx.de. * Distributed under the terms of the MIT License. * * Userland debugger support. @@ -7,6 +7,7 @@ #ifndef _KERNEL_USER_DEBUGGER_H #define _KERNEL_USER_DEBUGGER_H + #include #include @@ -32,7 +33,7 @@ struct thread; // (i.e. the struct team it lives in) isn't deleted. Thus one either needs to // acquire the global team lock, or one accesses the structure from a thread // of that team. -// 2) Access to the `flags' field is atomically. Reading via atomic_get() +// 2) Access to the `flags' field is atomic. Reading via atomic_get() // requires no further locks (in addition to 1) that is). Writing requires // `lock' being held and must be done atomically, too // (atomic_{set,and,or}()). Reading with `lock' being held doesn't need to @@ -148,6 +149,7 @@ enum { B_TEAM_DEBUG_KERNEL_FLAG_MASK = 0xffff, B_TEAM_DEBUG_DEFAULT_FLAGS = 0, + B_TEAM_DEBUG_INHERITED_FLAGS = B_TEAM_DEBUG_DEBUGGER_DISABLED }; // thread debugging flags (user-specifiable flags are in ) diff --git a/src/system/kernel/team.cpp b/src/system/kernel/team.cpp index a9793e5dfe..b1e04c29a0 100644 --- a/src/system/kernel/team.cpp +++ b/src/system/kernel/team.cpp @@ -1521,6 +1521,10 @@ fork_team(void) teamLocker.Unlock(); + // inherit some team debug flags + team->debug_info.flags |= atomic_get(&parentTeam->debug_info.flags) + & B_TEAM_DEBUG_INHERITED_FLAGS; + forkArgs = (struct fork_arg *)malloc(sizeof(struct fork_arg)); if (forkArgs == NULL) { status = B_NO_MEMORY;