Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] Environment variables passed to inferior for Cygwin build  ( follow up on mingw fix for PR 10989)
Date: Tue, 04 Oct 2011 10:40:00 -0000	[thread overview]
Message-ID: <E1RB2QN-0003Qv-81@fencepost.gnu.org> (raw)
In-Reply-To: <004801cc827b$e752bfd0$b5f83f70$@muller@ics-cnrs.unistra.fr>	(pierre.muller@ics-cnrs.unistra.fr)

> From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
> Date: Tue, 4 Oct 2011 11:56:35 +0200
> 
>   But, after looking into it, I suspect that your proposal
> was about setting only environment variables that have
> been explicitly modified within GDB... but the environment list is a 
> simple array of 'char *'.
>   Furthermore, there is no recording inside GDB code of
> environment variables that were explicitly modified.
>   in_env contains all environment variables coming from GDB startup.
> 
>   Thus, if I use your suggestion,
> call   cygwin_internal (CW_SYNC_WINENV); first
> and set environment variables after,
> PATH variable stays in cygwin form, which leads to a failure within
> CreateProcess call because some DLLs are not found.
> 
>   Using   cygwin_internal (CW_SYNC_WINENV);
> after settings individual environment variables
> using SetEnvironmentVariable call
> work, but I am not sure this is what you wanted.
> 
>   I am still sending here the patch, so you can test it, if you want.
> In fact, I suppose that the out_env part is not really needed:
> if no environment pointer is given, CreateProcess takes the environment of
> the parent process (which is GDB!), but we just modified it
> so that probably, leaving that part out would give the same result.

I'm confused: what problem(s) are you trying to fix in your patch?
Can you please enumerate the problems, and why do you think they
exist?  I think there's a misunderstanding here (I thought that about
the previous discussion in April, and I fear we will just repeat the
same misunderstanding now).

To comment on the part of what you say that I do understand: using
SetEnvironmentVariable in this case is not TRT, because that changes
the environment of GDB itself.  By contrast, "set environment" and
"unset environment" commands are supposed to affect only the
environment of the inferior, without any effect on GDB itself.  That
is why I didn't use SetEnvironmentVariable in my patch.


  reply	other threads:[~2011-10-04 10:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-11 13:24 [RFA] Environment variables passed to inferior by MinGW build (PR 10989) Eli Zaretskii
2011-09-11 22:03 ` asmwarrior
2011-09-19  8:04 ` Eli Zaretskii
2011-09-25 23:56   ` Eli Zaretskii
2011-09-26  5:22     ` Stan Shebs
2011-09-26 17:22       ` Joel Brobecker
2011-09-26 18:23         ` Eli Zaretskii
2011-09-28  9:39           ` Eli Zaretskii
2011-10-03 18:18             ` Tom Tromey
2011-10-03 18:25               ` Eli Zaretskii
2011-10-04  7:54         ` Corinna Vinschen
2011-10-04  9:29           ` Eli Zaretskii
2011-10-04 11:13             ` Corinna Vinschen
2011-10-04  9:56           ` [RFC] Environment variables passed to inferior for Cygwin build ( follow up on mingw fix for PR 10989) Pierre Muller
2011-10-04 10:40             ` Eli Zaretskii [this message]
2011-10-04 11:16               ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1RB2QN-0003Qv-81@fencepost.gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox