This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFA] testsuite: Add a test for passing of environment variables to inferior
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Eli Zaretskii'" <eliz at gnu dot org>, <gdb-patches at sourceware dot org>
- Date: Tue, 4 Oct 2011 16:48:15 +0200
- Subject: RE: [RFA] testsuite: Add a test for passing of environment variables to inferior
- References: <006301cc8292$367539b0$a35fad10$%muller@ics-cnrs.unistra.fr> <20111004134506.GB24369@calimero.vinschen.de> <83zkhgrf60.fsf@gnu.org>
> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Eli Zaretskii
> Envoyé?: mardi 4 octobre 2011 16:43
> À?: gdb-patches@sourceware.org
> Objet?: Re: [RFA] testsuite: Add a test for passing of environment
variables
> to inferior
>
> > Date: Tue, 4 Oct 2011 15:45:06 +0200
> > From: Corinna Vinschen <vinschen@redhat.com>
> >
> > 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 = environ;
> > environ = in_env;
> > cygwin_internal (CW_SYNC_WINENV);
> > CreateProcessW (NULL environment pointer);
> > environ = old_env;
>
> 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