From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28326 invoked by alias); 11 Dec 2012 14:25:54 -0000 Received: (qmail 28308 invoked by uid 22791); 11 Dec 2012 14:25:52 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 11 Dec 2012 14:25:46 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBBEPkQu024046 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 11 Dec 2012 09:25:46 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qBBEPiGE027171 for ; Tue, 11 Dec 2012 09:25:45 -0500 Message-ID: <50C74268.7090209@redhat.com> Date: Tue, 11 Dec 2012 14:25:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [RFA/mingw32] environment variables are case-insensitive on win32 References: <83wqx3t6r9.fsf@gnu.org> <20121130162852.GD32262@adacore.com> <50B902D0.6060809@redhat.com> <20121203113147.GB12055@adacore.com> <20121209235344.GA12152@ednor.casa.cgf.cx> <20121210105115.GB15147@adacore.com> <20121210110128.GA12570@calimero.vinschen.de> <20121210134935.GL31477@adacore.com> <20121210152408.GB11967@calimero.vinschen.de> <20121210154231.GC17188@adacore.com> <20121210155752.GA16027@calimero.vinschen.de> In-Reply-To: <20121210155752.GA16027@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-12/txt/msg00326.txt.bz2 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