From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32342 invoked by alias); 22 Feb 2002 17:05:41 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32224 invoked from network); 22 Feb 2002 17:05:32 -0000 Received: from unknown (HELO cerbere.u-strasbg.fr) (130.79.112.7) by sources.redhat.com with SMTP; 22 Feb 2002 17:05:32 -0000 Received: from laocoon (laocoon.u-strasbg.fr [130.79.112.72]) by cerbere.u-strasbg.fr (8.9.3/8.8.7) with ESMTP id SAA28514 for ; Fri, 22 Feb 2002 18:05:22 +0100 Message-Id: <4.2.0.58.20020222175830.01a86430@ics.u-strasbg.fr> X-Sender: muller@ics.u-strasbg.fr X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 Date: Fri, 22 Feb 2002 09:05:00 -0000 To: gdb-patches@sources.redhat.com From: Pierre Muller Subject: Re: [RFA] honor new-console and new-group in win32-nat.c In-Reply-To: <20020222162808.GA15597@redhat.com> References: <20020222162541.GI15032@redhat.com> <4.2.0.58.20020222094006.014b2518@ics.u-strasbg.fr> <20020222162541.GI15032@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2002-02/txt/msg00621.txt.bz2 >Actually. Wait. There's a better way to do this. Sorry. > >Just get rid of the flags = 0 and move the useshell stuff prior to >the flags |=. That's what I'd intended to do but muffed the placement >of the useshell conditionals. OK I committed this: 2002-02-22 Pierre Muller * win32-nat.c (child_create_inferior): Fix create flags setting bug. Index: win32-nat.c =================================================================== RCS file: /cvs/src/src/gdb/win32-nat.c,v retrieving revision 1.55 diff -u -p -r1.55 win32-nat.c --- win32-nat.c 2002/02/22 01:35:59 1.55 +++ win32-nat.c 2002/02/22 16:58:40 @@ -1468,14 +1468,6 @@ child_create_inferior (char *exec_file, memset (&si, 0, sizeof (si)); si.cb = sizeof (si); - flags = 0; - - if (new_group) - flags |= CREATE_NEW_PROCESS_GROUP; - - if (new_console) - flags |= CREATE_NEW_CONSOLE; - if (!useshell || !shell[0]) { flags = DEBUG_ONLY_THIS_PROCESS; @@ -1484,12 +1476,19 @@ child_create_inferior (char *exec_file, } else { - char *newallargs = alloca (sizeof (" -c 'exec '") + strlen (exec_file) strlen (allargs) + 2); + char *newallargs = alloca (sizeof (" -c 'exec '") + strlen (exec_file) + + strlen (allargs) + 2); sprintf (newallargs, " -c 'exec %s %s'", exec_file, allargs); allargs = newallargs; toexec = shell; flags = DEBUG_PROCESS; } + + if (new_group) + flags |= CREATE_NEW_PROCESS_GROUP; + + if (new_console) + flags |= CREATE_NEW_CONSOLE; args = alloca (strlen (toexec) + strlen (allargs) + 2); strcpy (args, toexec); Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99