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

This commit is contained in:
Bernhard Loos 2011-10-09 23:26:03 +02:00 committed by Alexandre Julliard
parent ad72c422ff
commit e7ec00d22c
3 changed files with 6 additions and 5 deletions

View File

@ -485,6 +485,7 @@ int debugger_detach( struct process *process, struct thread *debugger )
/* remove relationships between process and its debugger */ /* remove relationships between process and its debugger */
process->debugger = NULL; process->debugger = NULL;
process->debug_children = 0;
if (!set_process_debug_flag( process, 0 )) clear_error(); /* ignore error */ if (!set_process_debug_flag( process, 0 )) clear_error(); /* ignore error */
/* from this function */ /* from this function */

View File

@ -322,7 +322,7 @@ struct thread *create_process( int fd, struct thread *parent_thread, int inherit
process->priority = PROCESS_PRIOCLASS_NORMAL; process->priority = PROCESS_PRIOCLASS_NORMAL;
process->suspend = 0; process->suspend = 0;
process->is_system = 0; process->is_system = 0;
process->create_flags = 0; process->debug_children = 0;
process->console = NULL; process->console = NULL;
process->startup_state = STARTUP_IN_PROGRESS; process->startup_state = STARTUP_IN_PROGRESS;
process->startup_info = NULL; process->startup_info = NULL;
@ -937,7 +937,7 @@ DECL_HANDLER(new_process)
if (!(thread = create_process( socket_fd, current, req->inherit_all ))) goto done; if (!(thread = create_process( socket_fd, current, req->inherit_all ))) goto done;
process = thread->process; 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 ); process->startup_info = (struct startup_info *)grab_object( info );
/* connect to the window station */ /* connect to the window station */
@ -972,7 +972,7 @@ DECL_HANDLER(new_process)
/* attach to the debugger if requested */ /* attach to the debugger if requested */
if (req->create_flags & (DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS)) if (req->create_flags & (DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS))
set_process_debugger( process, current ); 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 ); set_process_debugger( process, parent->debugger );
if (!(req->create_flags & CREATE_NEW_PROCESS_GROUP)) if (!(req->create_flags & CREATE_NEW_PROCESS_GROUP))

View File

@ -66,8 +66,8 @@ struct process
affinity_t affinity; /* process affinity mask */ affinity_t affinity; /* process affinity mask */
int priority; /* priority class */ int priority; /* priority class */
int suspend; /* global process suspend count */ int suspend; /* global process suspend count */
int is_system; /* is it a system process? */ unsigned int is_system:1; /* is it a system process? */
unsigned int create_flags; /* process creation flags */ unsigned int debug_children:1;/* also debug all child processes */
struct list locks; /* list of file locks owned by the process */ struct list locks; /* list of file locks owned by the process */
struct list classes; /* window classes owned by the process */ struct list classes; /* window classes owned by the process */
struct console_input*console; /* console input */ struct console_input*console; /* console input */