Inherit the disable_debugger() flag to a fork()ed child. load_image() doesn't

-- I'm undecided whether it should, too. Fixes #4642.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33330 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-09-28 02:54:38 +00:00
parent 23338ed551
commit ac106be534
2 changed files with 8 additions and 2 deletions

View File

@ -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 <debugger.h>
#include <arch/user_debugger.h>
@ -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 <debugger.h>)

View File

@ -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;