From: Corinna Vinschen <vinschen@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA] Environment variables passed to inferior by MinGW build (PR 10989)
Date: Tue, 04 Oct 2011 11:13:00 -0000 [thread overview]
Message-ID: <20111004111257.GA22731@calimero.vinschen.de> (raw)
In-Reply-To: <E1RB1JO-0007S1-ES@fencepost.gnu.org>
On Oct 4 05:29, Eli Zaretskii wrote:
> > Date: Tue, 4 Oct 2011 09:53:26 +0200
> > From: Corinna Vinschen <vinschen@redhat.com>
> > Reply-To: gdb-patches@sourceware.org
> >
> > I was on vacation and I'm also not the area maintainer for windows-nat.c.
>
> No worries, I hope you had a good time ;-)
> I CC'ed you because you made the change that I partially undid, and
> also participated in some of the discussions I cited.
>
> > Eli's patch is ok, IMHO, but it's a pity that Pierre never followed up
> > to http://sourceware.org/ml/gdb-patches/2011-04/msg00351.html since that
> > means that now setting environment variables works in Mingw, but not in
> > Cygwin.
>
> Could you elaborate why the behavior on Cygwin is incorrect? AFAICT,
> Pierre's changes didn't get into GDB, so GDB still works as it did
> before, and your changes that introduced the call to cygwin_internal
> were supposed to fix the issue of "set environment" and "unset
> environment", right?
No, my changes from way back didn't handle `set env' and `unset env',
they actually introduced the problem. The cygwin_internal call was
necessary to sync Windows and Cygwin environment when calling
CreateProcess. At the time I neglected the internally set environment
vars and nobody noticed the mistake, apparently.
So, your patch is fine, I was just commenting on the fact that it would
have been nice if the patch cared for all code paths.
> > So, as far as I can see, PR #10989 should not have been closed
> > yet.
>
> But that bug report is for the MinGW host and target only, so if
> Cygwin has a similar problem, it's a different issue and probably also
> a different solution.
>
> OTOH, if the same code I re-introduced will work for Cygwin, it should
> be a simple matter to remove the #if conditionals. Am I missing
> something?
I'm quite busy catching up after vacaction right now. Off the top of
my head it might be the right thing to do, with a single exception:
It would be most helpful if the Windows environment is created as
UNICODE environment and CreateProcess uses the CREATE_UNICODE_ENVIRONMENT
flag. This should work pretty much identically for both code paths.
Using the Unicode environment has some advantages:
- The ANSI environment block is restricted to 64K in size, the UNICODE
environment block is not restricted at all.
- Using UNICODE makes the environment codepage agnostic.
- A single static function could be used to allocate and create the
environment for both code paths.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
next prev parent reply other threads:[~2011-10-04 11:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-11 13:24 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 [this message]
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
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=20111004111257.GA22731@calimero.vinschen.de \
--to=vinschen@redhat.com \
--cc=gdb-patches@sourceware.org \
/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