Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA/mingw32] environment variables are case-insensitive on win32
Date: Tue, 11 Dec 2012 14:25:00 -0000	[thread overview]
Message-ID: <50C74268.7090209@redhat.com> (raw)
In-Reply-To: <20121210155752.GA16027@calimero.vinschen.de>

On 12/10/2012 03:57 PM, Corinna Vinschen wrote:
> On Dec 10 16:42, Jerome Guitton wrote:
>> Corinna Vinschen (vinschen@redhat.com):
>>
>>> Cygwin is not Windows.  Cygwin is a UNIX-like system like Linux,
>>> Solaris, OpenBSD, etc.  The question you should ask is this:  Would
>>> you like to match environment variable names case-insensitive on Linux,
>>> Solaris, OpenBSD?  If the answer is "no", the answer for Cygwin is "no",
>>> too.
>>
>> Something may be broken in Cygwin's GDB, or maybe my version of Cygwin
>> is too old, because environment variables that have the same names are
>> identified in the inferior:
>>
>> guitton@kerel ~
>> $ export TEST_GDB_V=1                                                           
>> guitton@kerel ~
>> $ export TEST_GDB_v=2
>>
>> guitton@kerel ~
>> $ env | grep TEST_GDB
>> TEST_GDB_V=1
>> TEST_GDB_v=2
>>
>> guitton@kerel ~
>> $ /bin/gdb ./gdb/testsuite/gdb.base/testenv.exe 
>> [...]
>> (gdb) r
>> Starting program: /home/guitton/GIT/GDB/builds/obj.gdb-fsf.cygwin/gdb/testsuite/gdb.base/testenv.exe 
>> [New thread 12692.0x16ac]
>> [New thread 12692.0x22b0]
>> TEST_GDB_V=2
>> Program found 1 variables starting with TEST_GDB
> 
> Probably an old Cygwin version.  Older versions of Cygwin did not
> honor the case of env vars, but rather converted them all to uppercase,
> but this is pre-2008!

I'm confused by this.  It looks like even with such old Cygwin, Cygwin
programs treated environment variables as case-sensitive, otherwise
the

 $ env | grep TEST_GDB
 TEST_GDB_V=1
 TEST_GDB_v=2

in Jerome's test would have only shown one TEST_GDB_V, right?

Sounds like in this old Cygwin, the env vars are only coalesced when
going through CreateProcess?

And then, if that's true, a run time test in GDB like in the present
patch, doesn't actually detect this, because GDB itself is a Cygwin
program and will behave like those export + env calls?

Oh, I think that's what Jerome is saying in

 http://sourceware.org/ml/gdb-patches/2012-12/msg00134.html

?

In that case, this run-time test is looking like not helping
at all in practice.  The patch still has #ifdefs for _WIN32, so
it doesn't help with portability either.

Furthermore, I see from

  http://cygwin.com/cygwin-ug-net/using-cygwinenv.html

That CYGWINN=upcaseenv is more complicated than just case- or not
case-sensitivity.  Even without that set, Cygwin always uppercases
a set of environment variables, so it looks like a proper Cygwin
change would contemplate all of that somehow.

So all in all, I think we should just ignore Cygwin for now (leave it
case-sensitive like today), forget the run-time test in GDB, and go
back to focusing on Windows/mingw alone.

-- 
Pedro Alves


  parent reply	other threads:[~2012-12-11 14:25 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-30 13:37 Jerome Guitton
2012-11-30 13:47 ` Eli Zaretskii
2012-11-30 14:08   ` Jerome Guitton
2012-11-30 15:27     ` Eli Zaretskii
2012-11-30 15:34       ` Jerome Guitton
2012-11-30 16:07         ` Eli Zaretskii
2012-11-30 16:29           ` Jerome Guitton
2012-11-30 18:55             ` Eli Zaretskii
2012-12-07  9:22               ` Jerome Guitton
2012-12-07  9:30                 ` Eli Zaretskii
2012-12-07 10:06                   ` Jerome Guitton
2012-12-07 10:06                 ` Joel Brobecker
2012-12-07 10:11                   ` Jerome Guitton
2012-12-07 10:18                     ` Joel Brobecker
2012-11-30 19:02             ` Pedro Alves
2012-12-03 11:31               ` Jerome Guitton
2012-12-09 23:53                 ` Christopher Faylor
2012-12-10 10:51                   ` Jerome Guitton
2012-12-10 11:01                     ` Corinna Vinschen
2012-12-10 13:50                       ` Joel Brobecker
2012-12-10 15:24                         ` Corinna Vinschen
2012-12-10 15:42                           ` Jerome Guitton
2012-12-10 15:58                             ` Corinna Vinschen
2012-12-10 16:08                               ` Jerome Guitton
2012-12-10 16:09                               ` Eli Zaretskii
2012-12-10 16:17                                 ` Corinna Vinschen
2012-12-10 16:24                                   ` Jerome Guitton
2012-12-10 16:24                                   ` Eli Zaretskii
2012-12-10 16:57                                     ` Corinna Vinschen
2012-12-10 20:11                                       ` Eli Zaretskii
2012-12-11 10:20                                         ` Corinna Vinschen
2012-12-11 14:25                               ` Pedro Alves [this message]
2012-12-11 14:41                                 ` Corinna Vinschen
2012-12-11 15:07                                   ` Pedro Alves
2012-12-11 15:21                                     ` Corinna Vinschen
2012-12-11 15:23                                     ` Pierre Muller
2012-12-14 10:55                                       ` Jerome Guitton
2012-12-14 10:35                                 ` Jerome Guitton
2012-12-10 15:35                         ` Jerome Guitton
2012-12-10 16:09                           ` Pierre Muller
2012-12-10 16:18                             ` 'Jerome Guitton'
2012-12-10 16:27                               ` Pierre Muller
2012-12-10 16:54                                 ` Corinna Vinschen
2012-12-10 18:22                                   ` Jerome Guitton
2012-12-10 18:35                                     ` Pierre Muller
2012-12-10 18:36                                       ` 'Jerome Guitton'
2012-12-11  9:50                                         ` 'Jerome Guitton'
2012-12-11 16:27                               ` Christopher Faylor
     [not found]                           ` <002401cdd6f0$c0b317b0$42194710$%muller@ics-cnrs.unistra.fr>
2012-12-10 16:26                             ` Eli Zaretskii
2012-12-10 16:40                               ` Pierre Muller
2012-12-10 16:51                                 ` Jerome Guitton
2012-12-10 17:16                                 ` Jerome Guitton
2012-11-30 14:43 ` Pedro Alves
2012-11-30 15:03   ` Jerome Guitton
2012-11-30 15:38     ` Jerome Guitton
2012-11-30 15:41       ` Pedro Alves
2012-11-30 15:46         ` Tom Tromey
2012-11-30 15:49           ` Pedro Alves
2012-11-30 16:02         ` Jerome Guitton

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=50C74268.7090209@redhat.com \
    --to=palves@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