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: Corinna Vinschen <vinschen at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 4 Oct 2011 15:45:06 +0200
- Subject: Re: [RFA] testsuite: Add a test for passing of environment variables to inferior
- References: <006301cc8292$367539b0$a35fad10$@muller@ics-cnrs.unistra.fr>
- Reply-to: gdb-patches at sourceware dot org
On Oct 4 14:36, Pierre Muller wrote:
> Following Eli's comment that it was not clear
> what I wanted to achieve, I wrote a new test.
>
> Manually checking CVS GDB for mingw, Eli's patch
> gives the correct output.
> But Stock Cygwin GDB currently passes none of these
> TEST_GDB_XXX variables to inferior.
> Even the patch that I sent earlier is not correct:
> it still fails for the last test,
> once TEST_GDB_VAR1 has been set into GDB environment list,
> it doesn't get removed on the last start of the inferior...
>
> Corinna, I think this is the reason why I wanted to restore
> the original environment layout (to avoid leaving unset
> variables around.)
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;
> Anyhow, one more test in the testsuite to test
> an unchecked feature is always a good thing, no?
No doubt.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat