This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]