Commit e7ec00d2 authored by Bernhard Loos's avatar Bernhard Loos Committed by Alexandre Julliard

server: If a debugger is attached to a process, child processes shouldn't get debugged.

parent ad72c422
......@@ -485,6 +485,7 @@ int debugger_detach( struct process *process, struct thread *debugger )
/* remove relationships between process and its debugger */
process->debugger = NULL;
process->debug_children = 0;
if (!set_process_debug_flag( process, 0 )) clear_error(); /* ignore error */
/* from this function */
......
......@@ -322,7 +322,7 @@ struct thread *create_process( int fd, struct thread *parent_thread, int inherit
process->priority = PROCESS_PRIOCLASS_NORMAL;
process->suspend = 0;
process->is_system = 0;
process->create_flags = 0;
process->debug_children = 0;
process->console = NULL;
process->startup_state = STARTUP_IN_PROGRESS;
process->startup_info = NULL;
......@@ -937,7 +937,7 @@ DECL_HANDLER(new_process)
if (!(thread = create_process( socket_fd, current, req->inherit_all ))) goto done;
process = thread->process;
process->create_flags = req->create_flags;
process->debug_children = !(req->create_flags & DEBUG_ONLY_THIS_PROCESS);
process->startup_info = (struct startup_info *)grab_object( info );
/* connect to the window station */
......@@ -972,7 +972,7 @@ DECL_HANDLER(new_process)
/* attach to the debugger if requested */
if (req->create_flags & (DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS))
set_process_debugger( process, current );
else if (parent->debugger && !(parent->create_flags & DEBUG_ONLY_THIS_PROCESS))
else if (parent->debugger && parent->debug_children)
set_process_debugger( process, parent->debugger );
if (!(req->create_flags & CREATE_NEW_PROCESS_GROUP))
......
......@@ -66,8 +66,8 @@ struct process
affinity_t affinity; /* process affinity mask */
int priority; /* priority class */
int suspend; /* global process suspend count */
int is_system; /* is it a system process? */
unsigned int create_flags; /* process creation flags */
unsigned int is_system:1; /* is it a system process? */
unsigned int debug_children:1;/* also debug all child processes */
struct list locks; /* list of file locks owned by the process */
struct list classes; /* window classes owned by the process */
struct console_input*console; /* console input */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment