From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18133 invoked by alias); 4 Oct 2011 14:48:52 -0000 Received: (qmail 18125 invoked by uid 22791); 4 Oct 2011 14:48:51 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.153) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Oct 2011 14:48:27 +0000 Received: from md1.u-strasbg.fr (md1.u-strasbg.fr [IPv6:2001:660:2402::186]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id p94EmGuK062353 ; Tue, 4 Oct 2011 16:48:16 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms3.u-strasbg.fr [130.79.204.12]) by md1.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p94EmG9g013628 ; Tue, 4 Oct 2011 16:48:16 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p94EmGRp006849 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) ; Tue, 4 Oct 2011 16:48:16 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Eli Zaretskii'" , References: <006301cc8292$367539b0$a35fad10$%muller@ics-cnrs.unistra.fr> <20111004134506.GB24369@calimero.vinschen.de> <83zkhgrf60.fsf@gnu.org> In-Reply-To: <83zkhgrf60.fsf@gnu.org> Subject: RE: [RFA] testsuite: Add a test for passing of environment variables to inferior Date: Tue, 04 Oct 2011 14:48:00 -0000 Message-ID: <000601cc82a4$a625e310$f271a930$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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-10/txt/msg00077.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Eli Zaretskii > Envoy=E9=A0: mardi 4 octobre 2011 16:43 > =C0=A0: gdb-patches@sourceware.org > Objet=A0: Re: [RFA] testsuite: Add a test for passing of environment variables > to inferior >=20 > > Date: Tue, 4 Oct 2011 15:45:06 +0200 > > From: Corinna Vinschen > > > > Yes, that would be necessary. I'm wondering if we can't just utilze the > > global environ variable for this and spare us all the hassle. Something > > along these lines: > > > > char **old_env =3D environ; > > environ =3D in_env; > > cygwin_internal (CW_SYNC_WINENV); > > CreateProcessW (NULL environment pointer); > > environ =3D old_env; >=20 > If my reading of sync_winenv is correct, you'd need one more call to > cygwin_internal after restoring `environ'. Otherwise, the Windows > environment of GDB will be left at the value passed to the inferior, > which could have all kinds of weird unexpected effects elsewhere in > GDB. No, this is not enough, see my next email... Pierre