Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: <gdb-patches@sourceware.org>
Cc: "'Corinna Vinschen'" <vinschen@redhat.com>
Subject: RE: [RFC] Add support for locally modified environment variables for windows-nat.c
Date: Wed, 20 Apr 2011 12:06:00 -0000	[thread overview]
Message-ID: <001501cbff53$465030a0$d2f091e0$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <20110420115528.GA5842@calimero.vinschen.de>



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Corinna Vinschen
> Envoyé : mercredi 20 avril 2011 13:55
> À : gdb-patches@sourceware.org
> Objet : Re: [RFC] Add support for locally modified environment variables for
> windows-nat.c
> 
> On Apr 20 12:26, Pierre Muller wrote:
> > A while ago
> > Sebastian Puebla submitted a patch for
> > support of locally modified environment variables.
> >
> > http://sourceware.org/ml/gdb-patches/2010-05/msg00317.html
> > http://sourceware.org/ml/gdb-patches/2010-08/msg00026.html
> > http://sourceware.org/ml/gdb-patches/2010-11/msg00128.html
> >
> > Nevertheless, I suspect that his patch would not have worked for Cygwin,
> > because Cygwin converts several environment variables
> > from windows style to POSIX style.
> 
> Do you suspect or did you actually test it?  What you're trying to
> accomplish is actually the task of the
> 
>   cygwin_internal (CW_SYNC_WINENV);
> 
> call right before calling CreateProcess.  This allows to keep the actual
> underlying details of the environment handling entirely in the hands of
> Cygwin.  Especially copying an internal list of env vars from Cygwin
> into GDB makes me very uncomfortable since this is bound to break as
> soon as we decide to handle things a bit different in Cygwin.

  The problem is that this does not handle
(gdb) set environment TEST=My dummy test
which is supposed to be passed to the inferior.
after the commands above the in_env char * vector
will have an additional entry "TEST=My dummy test"
but the internal environment variables of GDB itself
are not changed.
  I suspect that cygwin_internal (CW_SYNC_WINENV);
only acts on the environment variables of GDB itself.

Does that mean that we should instead copy this in_env
array using cygwin set_env function before calling cygwin_internal?
If this is true, do we need to restore the environment state of GDB
after?
 
> Of course it's cgf's call, but I don't think this is the right thing to
> do.  If this is actually broken, it's the cygwin_internal(CW_SYNC_WINENV)
> implementation in Cygwin which should be fixed, rather than GDB going
> out of its way to emulate what happens in Cygwin internally.

  Thanks you for explaining the cygwin_internal call.
Of course my current patch does invalidate this as out_env array is used 
instead of the current GDB environment variables.

  If you think that the proposal above is the right track for
Cygwin, I will try to implement this.

Pierre


  reply	other threads:[~2011-04-20 12:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-20 10:26 Pierre Muller
2011-04-20 11:56 ` Corinna Vinschen
2011-04-20 12:06   ` Pierre Muller [this message]
2011-04-20 12:31     ` Corinna Vinschen
2011-04-23 16:21     ` Christopher Faylor

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='001501cbff53$465030a0$d2f091e0$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --cc=gdb-patches@sourceware.org \
    --cc=vinschen@redhat.com \
    /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