From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25540 invoked by alias); 16 Sep 2011 14:52:51 -0000 Received: (qmail 25524 invoked by uid 22791); 16 Sep 2011 14:52:51 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,TW_RG X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Sep 2011 14:52:34 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 5D905CB039C; Fri, 16 Sep 2011 16:52:35 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9YqW7szs91Ba; Fri, 16 Sep 2011 16:52:25 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 1AB71CB0395; Fri, 16 Sep 2011 16:52:25 +0200 (CEST) Subject: Re: [RFA] Preliminary work in fork_inferior Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=windows-1252 From: Tristan Gingold In-Reply-To: Date: Fri, 16 Sep 2011 14:55:00 -0000 Cc: "gdb-patches@sourceware.org ml" , Pedro Alves Content-Transfer-Encoding: quoted-printable Message-Id: <8863EA9F-FF7C-4A5C-B625-8CDF225797CD@adacore.com> References: <201109071409.06452.pedro@codesourcery.com> <8B49B563-BE0B-452C-8956-31E00A880D96@adacore.com> To: Abhijit Halder X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00305.txt.bz2 On Sep 16, 2011, at 4:43 PM, Abhijit Halder wrote: > On Fri, Sep 16, 2011 at 5:58 PM, Tristan Gingold wr= ote: [=85] >> --- a/gdb/fork-child.c >> +++ b/gdb/fork-child.c >> @@ -126,9 +126,7 @@ fork_inferior (char *exec_file_arg, char *allargs, c= har **env, >> void (*pre_trace_fun) (void), char *shell_file_arg) >> { >> int pid; >> - char *shell_command; >> static char default_shell_file[] =3D SHELL_FILE; > I don't know whether this is relevant, but I think the SHELL_FILE > macro is defined as "/bin/sh" and this will not work for MinGW. Some > similar comments were popped up during the review of my patch for > adding pipe command in GDB. I'm relating this to that. Well, given that this file deals with spawning via [v]fork+exec it won't wo= rk at all for MinGW :-) >> - argv =3D (char **) xmalloc (argc * sizeof (*argv)); >> + argv =3D (char **) alloca (argc * sizeof (*argv)); > alloca is not a portable function I guess. Although alloca is not part of ANSI-C, it is heavily used by GNU software a= nd available almost everywhere. There is even a replacement alloca function in libiberty but I am pretty su= re it wasn't used for a long time. Tristan.