* [RFA/mingw32] environment variables are case-insensitive on win32
@ 2012-11-30 13:37 Jerome Guitton
2012-11-30 13:47 ` Eli Zaretskii
2012-11-30 14:43 ` Pedro Alves
0 siblings, 2 replies; 59+ messages in thread
From: Jerome Guitton @ 2012-11-30 13:37 UTC (permalink / raw)
To: gdb-patches; +Cc: Jerome Guitton
A patch that I sent a few months ago, I think, but never got in:
environment variables are case-insensitive on windows, this patch would
take that into account.
It would have been nice to have a configure test for that, using
setenv/getenv to detect the case insensitivity. Unfortunately we
don't have setenv on win32. So I ended up using _WIN32 just like we do
to handle the .exe extension. Any other idea?
I could not run the testsuite on Windows though; so I run it on
x86-linux just to make sure that it had no effect on it. Note that the
problem does not reproduce when GDB is run from cygwin, which makes it
even harder to test. So I ended up using AdaCore's internal testsuite
to validate this.
gdb/ChangeLog:
* environ.c (env_var_name_ncmp): New macro.
(get_in_environ, set_in_environ, unset_in_environ): Use
env_var_name_ncmp instead of strncmp.
---
gdb/environ.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/gdb/environ.c b/gdb/environ.c
index 33426eb..2201926 100644
--- a/gdb/environ.c
+++ b/gdb/environ.c
@@ -96,6 +96,13 @@ environ_vector (struct gdb_environ *e)
return e->vector;
}
\f
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define env_var_name_ncmp(a, b, length) strncasecmp (a, b, length)
+#else
+#define env_var_name_ncmp(a, b, length) strncmp(a, b, length)
+#endif
+
/* Return the value in environment E of variable VAR. */
char *
@@ -106,7 +113,7 @@ get_in_environ (const struct gdb_environ *e, const char *var)
char *s;
for (; (s = *vector) != NULL; vector++)
- if (strncmp (s, var, len) == 0 && s[len] == '=')
+ if (env_var_name_ncmp (s, var, len) == 0 && s[len] == '=')
return &s[len + 1];
return 0;
@@ -123,7 +130,7 @@ set_in_environ (struct gdb_environ *e, const char *var, const char *value)
char *s;
for (i = 0; (s = vector[i]) != NULL; i++)
- if (strncmp (s, var, len) == 0 && s[len] == '=')
+ if (env_var_name_ncmp (s, var, len) == 0 && s[len] == '=')
break;
if (s == 0)
@@ -170,7 +177,7 @@ unset_in_environ (struct gdb_environ *e, char *var)
for (; (s = *vector) != NULL; vector++)
{
- if (strncmp (s, var, len) == 0 && s[len] == '=')
+ if (env_var_name_ncmp (s, var, len) == 0 && s[len] == '=')
{
xfree (s);
/* Walk through the vector, shuffling args down by one, including
--
1.7.10.4
^ permalink raw reply [flat|nested] 59+ messages in thread* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 13:37 [RFA/mingw32] environment variables are case-insensitive on win32 Jerome Guitton
@ 2012-11-30 13:47 ` Eli Zaretskii
2012-11-30 14:08 ` Jerome Guitton
2012-11-30 14:43 ` Pedro Alves
1 sibling, 1 reply; 59+ messages in thread
From: Eli Zaretskii @ 2012-11-30 13:47 UTC (permalink / raw)
To: Jerome Guitton; +Cc: gdb-patches
> From: Jerome Guitton <guitton@adacore.com>
> Cc: Jerome Guitton <guitton@adacore.com>
> Date: Fri, 30 Nov 2012 14:36:37 +0100
>
> A patch that I sent a few months ago, I think, but never got in:
> environment variables are case-insensitive on windows, this patch would
> take that into account.
Thanks. But why did you exclude Cygwin?
> It would have been nice to have a configure test for that, using
> setenv/getenv to detect the case insensitivity. Unfortunately we
> don't have setenv on win32. So I ended up using _WIN32 just like we do
> to handle the .exe extension. Any other idea?
Use putenv?
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 13:47 ` Eli Zaretskii
@ 2012-11-30 14:08 ` Jerome Guitton
2012-11-30 15:27 ` Eli Zaretskii
0 siblings, 1 reply; 59+ messages in thread
From: Jerome Guitton @ 2012-11-30 14:08 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
Eli Zaretskii (eliz@gnu.org):
> Thanks. But why did you exclude Cygwin?
Cygwin seems to be case-sensitive:
guitton@kerel ~
$ export FooBar=Bar
guitton@kerel ~
$ export FooBAR=BAR
guitton@kerel ~
$ echo $FooBar
Bar
guitton@kerel ~
$ echo $FooBAR
BAR
> > It would have been nice to have a configure test for that, using
> > setenv/getenv to detect the case insensitivity. Unfortunately we
> > don't have setenv on win32. So I ended up using _WIN32 just like we do
> > to handle the .exe extension. Any other idea?
>
> Use putenv?
I feel silly :)
I'll work on that.
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 14:08 ` Jerome Guitton
@ 2012-11-30 15:27 ` Eli Zaretskii
2012-11-30 15:34 ` Jerome Guitton
0 siblings, 1 reply; 59+ messages in thread
From: Eli Zaretskii @ 2012-11-30 15:27 UTC (permalink / raw)
To: Jerome Guitton; +Cc: gdb-patches
> Date: Fri, 30 Nov 2012 15:08:44 +0100
> From: Jerome Guitton <guitton@adacore.com>
> Cc: gdb-patches@sourceware.org
>
> Eli Zaretskii (eliz@gnu.org):
>
> > Thanks. But why did you exclude Cygwin?
>
> Cygwin seems to be case-sensitive:
>
> guitton@kerel ~
> $ export FooBar=Bar
>
> guitton@kerel ~
> $ export FooBAR=BAR
>
> guitton@kerel ~
> $ echo $FooBar
> Bar
>
> guitton@kerel ~
> $ echo $FooBAR
> BAR
This is Bash, not Cygwin. What happens if you define an environment
variable outside of a Cygwin program, and then use getenv in a Cygwin
program with different letter-case?
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 15:27 ` Eli Zaretskii
@ 2012-11-30 15:34 ` Jerome Guitton
2012-11-30 16:07 ` Eli Zaretskii
0 siblings, 1 reply; 59+ messages in thread
From: Jerome Guitton @ 2012-11-30 15:34 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
Eli Zaretskii (eliz@gnu.org):
> This is Bash, not Cygwin. What happens if you define an environment
> variable outside of a Cygwin program, and then use getenv in a Cygwin
> program with different letter-case?
I tried something similar actually:
#include <stdio.h>
#include <stdlib.h>
int
main()
{
char *name;
#if defined(_WIN32) && !defined(__CYGWIN__)
_putenv ("foobar=set");
#else
setenv("foobar", "set", 1);
#endif
name = getenv("FooBar");
if (name && strcmp (name, "set") == 0)
printf ("not case sensitive\n");
else
printf ("case sensitive\n");
return 1;
}
Same result: case sensitive.
^ permalink raw reply [flat|nested] 59+ messages in thread* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 15:34 ` Jerome Guitton
@ 2012-11-30 16:07 ` Eli Zaretskii
2012-11-30 16:29 ` Jerome Guitton
0 siblings, 1 reply; 59+ messages in thread
From: Eli Zaretskii @ 2012-11-30 16:07 UTC (permalink / raw)
To: Jerome Guitton; +Cc: gdb-patches
> Date: Fri, 30 Nov 2012 16:34:01 +0100
> From: Jerome Guitton <guitton@adacore.com>
> Cc: gdb-patches@sourceware.org
>
> #include <stdio.h>
> #include <stdlib.h>
>
> int
> main()
> {
> char *name;
>
> #if defined(_WIN32) && !defined(__CYGWIN__)
> _putenv ("foobar=set");
> #else
> setenv("foobar", "set", 1);
> #endif
> name = getenv("FooBar");
>
> if (name && strcmp (name, "set") == 0)
> printf ("not case sensitive\n");
> else
> printf ("case sensitive\n");
>
> return 1;
> }
>
>
> Same result: case sensitive.
Thanks, now we know.
^ permalink raw reply [flat|nested] 59+ messages in thread* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 16:07 ` Eli Zaretskii
@ 2012-11-30 16:29 ` Jerome Guitton
2012-11-30 18:55 ` Eli Zaretskii
2012-11-30 19:02 ` Pedro Alves
0 siblings, 2 replies; 59+ messages in thread
From: Jerome Guitton @ 2012-11-30 16:29 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
Eli Zaretskii (eliz@gnu.org):
> > Same result: case sensitive.
>
> Thanks, now we know.
Hmm. From what I read in Cygwin's documentation, the situation could
actually be a bit more complex than that. There is at least an option
(upcaseenv) that can have an impact on Cygwin's behavior. So a test at
configure time would be useful.
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 16:29 ` Jerome Guitton
@ 2012-11-30 18:55 ` Eli Zaretskii
2012-12-07 9:22 ` Jerome Guitton
2012-11-30 19:02 ` Pedro Alves
1 sibling, 1 reply; 59+ messages in thread
From: Eli Zaretskii @ 2012-11-30 18:55 UTC (permalink / raw)
To: Jerome Guitton; +Cc: gdb-patches
> Date: Fri, 30 Nov 2012 17:28:52 +0100
> From: Jerome Guitton <guitton@adacore.com>
> Cc: gdb-patches@sourceware.org
>
> Eli Zaretskii (eliz@gnu.org):
>
> > > Same result: case sensitive.
> >
> > Thanks, now we know.
>
> Hmm. From what I read in Cygwin's documentation, the situation could
> actually be a bit more complex than that. There is at least an option
> (upcaseenv) that can have an impact on Cygwin's behavior. So a test at
> configure time would be useful.
Configure-time test is not good enough, as the binary could then be
run in a different environment.
How about making it case-insensitive for Cygwin as well?
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
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 ` Joel Brobecker
0 siblings, 2 replies; 59+ messages in thread
From: Jerome Guitton @ 2012-12-07 9:22 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 739 bytes --]
Eli Zaretskii (eliz@gnu.org):
> Configure-time test is not good enough, as the binary could then be
> run in a different environment.
>
> How about making it case-insensitive for Cygwin as well?
I ended up implementing Pedro's suggestion (a run-time test) but it
does not work in the case of Cygwin; getenv/setenv acts as if we add a
case-sensitive environment, but we use CreateProcess to create the
inferior, so we end up with a case-insensitive environment for the
inferior. So making it case-insensitive is indeed what makes sense.
Last versions of the patch in attachment, along with the testcase.
Fully tested on x86_64-linux; partially tested on Cygwin (e.g. without
gdb.threads) amd mingw32 (testenv.exp only).
Any comments?
[-- Attachment #2: path_case.diff --]
[-- Type: text/x-diff, Size: 4403 bytes --]
commit b67dcf26ae8f9ae0390c229518fe34456b4dfe20
Author: Jerome Guitton <guitton@adacore.com>
Date: Wed Dec 5 15:48:29 2012 +0100
Add test for case sensitivity in env vars
gdb/testsuite/ChangeLog:
* gdb.base/testenv.exp: Check consistent case sensitivity of
env variables.
diff --git a/gdb/testsuite/gdb.base/testenv.exp b/gdb/testsuite/gdb.base/testenv.exp
index 55e3088..4b681a5 100644
--- a/gdb/testsuite/gdb.base/testenv.exp
+++ b/gdb/testsuite/gdb.base/testenv.exp
@@ -123,3 +123,40 @@ gdb_exit
# Clear environment in case we're doing multiple runs
unset env(TEST_GDB_GLOBAL)
+# Check consistent case sensitivity of env variables
+# for GDB and the inferior
+
+clean_restart $binfile
+
+set upper_case_value "VAR1"
+set mixed_case_value "Var1"
+gdb_test_no_output "set env TEST_GDB_VAR1 $upper_case_value" \
+ "Set TEST_GDB_VAR1"
+
+gdb_test_no_output "set env TEST_GDB_Var1 $mixed_case_value" \
+ "Set TEST_GDB_Var1"
+
+set test "Case sensitivity for env vars in GDB"
+set var1_value $upper_case_value
+set nb_vars 2
+gdb_test_multiple "show env TEST_GDB_VAR1" $test {
+ -re ".*TEST_GDB_VAR1 = $upper_case_value.*$gdb_prompt $" {
+ set nb_vars 2
+ pass $test
+ }
+ -re ".*TEST_GDB_VAR1 = $mixed_case_value.*$gdb_prompt $" {
+ set nb_vars 1
+ pass $test
+ }
+}
+
+# make sure $pc is sane, in case we're talking to a board.
+if { ![runto_main] } {
+ gdb_suppress_tests;
+}
+
+gdb_breakpoint $bp_line
+gdb_test "continue" \
+ ".*Program found ${nb_vars} variables starting with TEST_GDB.*" \
+ "Case sensitivity for env vars in inferior"
+gdb_exit
commit df61bd719e348f530419215ce71f344198231d7f
Author: Jerome Guitton <guitton@adacore.com>
Date: Thu May 24 18:19:23 2012 +0200
environment variables are case-insensitive on win32
gdb/ChangeLog:
* environ.c (host_has_case_sensitive_env_vars)
(env_var_name_ncmp): New functions.
(get_in_environ, set_in_environ, unset_in_environ): Use
env_var_name_ncmp instead of strncmp.
diff --git a/gdb/environ.c b/gdb/environ.c
index 33426eb..e4cc30c 100644
--- a/gdb/environ.c
+++ b/gdb/environ.c
@@ -96,6 +96,57 @@ environ_vector (struct gdb_environ *e)
return e->vector;
}
\f
+
+/* Return 1 if the names of environ variables are case sensitive
+ on host. */
+
+static int
+host_has_case_sensitive_env_vars()
+{
+ static int result = -1;
+ char *value;
+
+ if (result != -1)
+ return result;
+
+ /* On Cygwin, setenv/getenv supports case-sensitive environment
+ variables; so the run-time check would return 1. However, GDB
+ uses the windows API to create the inferior, which is case
+ insensitive. So override the check. */
+
+#if defined (__CYGWIN__)
+ result = 0;
+ return result;
+
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+ putenv ("__GDB_TEST_CASE_SENSITIVITY=set");
+
+#else
+ setenv ("__GDB_TEST_CASE_SENSITIVITY", "set", 1);
+#endif
+
+ value = getenv ("__GDB_test_CASE_Sensitivity");
+
+ if (value && (strcmp (value, "set") == 0))
+ result = 0;
+ else
+ result = 1;
+
+ return result;
+}
+
+/* Compare the first LENGTH characters of the names of two
+ environment variable A and B. */
+
+static int
+env_var_name_ncmp(const char *a, const char *b, int length)
+{
+ if (host_has_case_sensitive_env_vars())
+ return strncmp(a, b, length);
+ else
+ return strncasecmp (a, b, length);
+}
+
/* Return the value in environment E of variable VAR. */
char *
@@ -106,7 +157,7 @@ get_in_environ (const struct gdb_environ *e, const char *var)
char *s;
for (; (s = *vector) != NULL; vector++)
- if (strncmp (s, var, len) == 0 && s[len] == '=')
+ if (env_var_name_ncmp (s, var, len) == 0 && s[len] == '=')
return &s[len + 1];
return 0;
@@ -123,7 +174,7 @@ set_in_environ (struct gdb_environ *e, const char *var, const char *value)
char *s;
for (i = 0; (s = vector[i]) != NULL; i++)
- if (strncmp (s, var, len) == 0 && s[len] == '=')
+ if (env_var_name_ncmp (s, var, len) == 0 && s[len] == '=')
break;
if (s == 0)
@@ -170,7 +221,7 @@ unset_in_environ (struct gdb_environ *e, char *var)
for (; (s = *vector) != NULL; vector++)
{
- if (strncmp (s, var, len) == 0 && s[len] == '=')
+ if (env_var_name_ncmp (s, var, len) == 0 && s[len] == '=')
{
xfree (s);
/* Walk through the vector, shuffling args down by one, including
^ permalink raw reply [flat|nested] 59+ messages in thread* Re: [RFA/mingw32] environment variables are case-insensitive on win32
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
1 sibling, 1 reply; 59+ messages in thread
From: Eli Zaretskii @ 2012-12-07 9:30 UTC (permalink / raw)
To: Jerome Guitton; +Cc: gdb-patches
> Date: Fri, 7 Dec 2012 10:22:02 +0100
> From: Jerome Guitton <guitton@adacore.com>
> Cc: gdb-patches@sourceware.org
>
> Eli Zaretskii (eliz@gnu.org):
>
> > Configure-time test is not good enough, as the binary could then be
> > run in a different environment.
> >
> > How about making it case-insensitive for Cygwin as well?
>
> I ended up implementing Pedro's suggestion (a run-time test) but it
> does not work in the case of Cygwin; getenv/setenv acts as if we add a
> case-sensitive environment, but we use CreateProcess to create the
> inferior, so we end up with a case-insensitive environment for the
> inferior. So making it case-insensitive is indeed what makes sense.
>
> Last versions of the patch in attachment, along with the testcase.
> Fully tested on x86_64-linux; partially tested on Cygwin (e.g. without
> gdb.threads) amd mingw32 (testenv.exp only).
>
> Any comments?
The attached patch still uses a run-time test. Did you attach a wrong
patch?
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-07 9:30 ` Eli Zaretskii
@ 2012-12-07 10:06 ` Jerome Guitton
0 siblings, 0 replies; 59+ messages in thread
From: Jerome Guitton @ 2012-12-07 10:06 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
Eli Zaretskii (eliz@gnu.org):
> The attached patch still uses a run-time test. Did you attach a wrong
> patch?
That's the patch I meant to attach; there is a special case for
Cygwin in the run-time test, it just returns case-insensitive
inconditionally for this platform.
Now it is true that Windows is the only platform that I know that has
case-insensitive environment variables, and if even for Cygwin we have
to get back to case-insensitivity then a run-time test may be overkill.
I'd OK with any choice that we make about that.
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-07 9:22 ` Jerome Guitton
2012-12-07 9:30 ` Eli Zaretskii
@ 2012-12-07 10:06 ` Joel Brobecker
2012-12-07 10:11 ` Jerome Guitton
1 sibling, 1 reply; 59+ messages in thread
From: Joel Brobecker @ 2012-12-07 10:06 UTC (permalink / raw)
To: Jerome Guitton; +Cc: gdb-patches
Hi Jerome,
I noticed one small issue:
> +# make sure $pc is sane, in case we're talking to a board.
> +if { ![runto_main] } {
> + gdb_suppress_tests;
We do not use the suppress_... routines anymore. Usually, at
the start of a test, we use untested, IIRC.
--
Joel
^ permalink raw reply [flat|nested] 59+ messages in thread* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-07 10:06 ` Joel Brobecker
@ 2012-12-07 10:11 ` Jerome Guitton
2012-12-07 10:18 ` Joel Brobecker
0 siblings, 1 reply; 59+ messages in thread
From: Jerome Guitton @ 2012-12-07 10:11 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
Joel Brobecker (brobecker@adacore.com):
> We do not use the suppress_... routines anymore. Usually, at
> the start of a test, we use untested, IIRC.
OK. As I was adding to an existing testcase I followed its style.
I can fix that for the whole testcase in an other commit.
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-07 10:11 ` Jerome Guitton
@ 2012-12-07 10:18 ` Joel Brobecker
0 siblings, 0 replies; 59+ messages in thread
From: Joel Brobecker @ 2012-12-07 10:18 UTC (permalink / raw)
To: Jerome Guitton; +Cc: gdb-patches
> OK. As I was adding to an existing testcase I followed its style.
> I can fix that for the whole testcase in an other commit.
Thanks! In the middle of the test, my guess is that it's probably
more logical to use return as opposed to untested, but I am a little
fuzzy on that...
--
Joel
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 16:29 ` Jerome Guitton
2012-11-30 18:55 ` Eli Zaretskii
@ 2012-11-30 19:02 ` Pedro Alves
2012-12-03 11:31 ` Jerome Guitton
1 sibling, 1 reply; 59+ messages in thread
From: Pedro Alves @ 2012-11-30 19:02 UTC (permalink / raw)
To: Jerome Guitton; +Cc: Eli Zaretskii, gdb-patches
On 11/30/2012 04:28 PM, Jerome Guitton wrote:
> Eli Zaretskii (eliz@gnu.org):
>
>>> Same result: case sensitive.
>>
>> Thanks, now we know.
>
> Hmm. From what I read in Cygwin's documentation, the situation could
> actually be a bit more complex than that. There is at least an option
> (upcaseenv) that can have an impact on Cygwin's behavior. So a test at
> configure time would be useful.
You could do a little setenv/getenv test in gdb itself (and cache the
result), much like your little test you posted before, but built in.
Use some unlikely environment var name (__GDB_TEST_CASE_SENSITIVITY or
some such).
--
Pedro Alves
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 19:02 ` Pedro Alves
@ 2012-12-03 11:31 ` Jerome Guitton
2012-12-09 23:53 ` Christopher Faylor
0 siblings, 1 reply; 59+ messages in thread
From: Jerome Guitton @ 2012-12-03 11:31 UTC (permalink / raw)
To: Pedro Alves; +Cc: Eli Zaretskii, gdb-patches
Pedro Alves (palves@redhat.com):
> You could do a little setenv/getenv test in gdb itself (and cache the
> result), much like your little test you posted before, but built in.
> Use some unlikely environment var name (__GDB_TEST_CASE_SENSITIVITY or
> some such).
OK; thank you. I'll implement that.
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-03 11:31 ` Jerome Guitton
@ 2012-12-09 23:53 ` Christopher Faylor
2012-12-10 10:51 ` Jerome Guitton
0 siblings, 1 reply; 59+ messages in thread
From: Christopher Faylor @ 2012-12-09 23:53 UTC (permalink / raw)
To: Pedro Alves, gdb-patches, Jerome Guitton, Eli Zaretskii
On Mon, Dec 03, 2012 at 12:31:47PM +0100, Jerome Guitton wrote:
>Pedro Alves (palves@redhat.com):
>
>> You could do a little setenv/getenv test in gdb itself (and cache the
>> result), much like your little test you posted before, but built in.
>> Use some unlikely environment var name (__GDB_TEST_CASE_SENSITIVITY or
>> some such).
>
>OK; thank you. I'll implement that.
I wasn't entirely sure what was decided for Cygwin but Cygwin
environment variables are meant, like Linux, to be case sensitive.
Please keep that in mind when implementing this. The CYGWIN=upcaseenv
is a special case and not something that you should have to worry about.
cgf
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-09 23:53 ` Christopher Faylor
@ 2012-12-10 10:51 ` Jerome Guitton
2012-12-10 11:01 ` Corinna Vinschen
0 siblings, 1 reply; 59+ messages in thread
From: Jerome Guitton @ 2012-12-10 10:51 UTC (permalink / raw)
To: Pedro Alves, gdb-patches, Eli Zaretskii
Christopher Faylor (cgf-use-the-mailinglist-please@sourceware.org):
> I wasn't entirely sure what was decided for Cygwin but Cygwin
> environment variables are meant, like Linux, to be case sensitive.
> Please keep that in mind when implementing this. The CYGWIN=upcaseenv
> is a special case and not something that you should have to worry about.
Right, but when GDB creates the inferior it first convert the Cygwin
environment to Win32 (using CW_CVT_ENV_TO_WINENV) and then uses
directly CreateProcess. So it seems that the the case sensitivity is
lost in the process...
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 10:51 ` Jerome Guitton
@ 2012-12-10 11:01 ` Corinna Vinschen
2012-12-10 13:50 ` Joel Brobecker
0 siblings, 1 reply; 59+ messages in thread
From: Corinna Vinschen @ 2012-12-10 11:01 UTC (permalink / raw)
To: gdb-patches
On Dec 10 11:51, Jerome Guitton wrote:
> Christopher Faylor (cgf-use-the-mailinglist-please@sourceware.org):
>
> > I wasn't entirely sure what was decided for Cygwin but Cygwin
> > environment variables are meant, like Linux, to be case sensitive.
> > Please keep that in mind when implementing this. The CYGWIN=upcaseenv
> > is a special case and not something that you should have to worry about.
>
> Right, but when GDB creates the inferior it first convert the Cygwin
> environment to Win32 (using CW_CVT_ENV_TO_WINENV) and then uses
> directly CreateProcess. So it seems that the the case sensitivity is
> lost in the process...
No, it's not. The Windows environment is NOT case insensitive, it's
case-preserving. That's a big difference. A process inherits the
environment in exactly the same case as has been used by its parent.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
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:35 ` Jerome Guitton
0 siblings, 2 replies; 59+ messages in thread
From: Joel Brobecker @ 2012-12-10 13:50 UTC (permalink / raw)
To: gdb-patches
> No, it's not. The Windows environment is NOT case insensitive, it's
> case-preserving. That's a big difference. A process inherits the
> environment in exactly the same case as has been used by its parent.
I would like to pause this discussion about cygwin for a second,
here: I am concerned that we are slowly allowing ourselves to
hold Jerome's patch, which works on MinGW, because it does not fix
the problem on cygwin.
Jerome is happy to try to help if it's not too time consuming,
but it is starting to look like things are far from simple in
this case.
This is why I propose we do 2 things:
1. Decide whether we want GDB to match environment variable names
using case-sensitive or case-insensentive functions on cygwin.
Right now, it's case-sensitive. FWIW, we are offering to change
that behavior, and it seems more user-friencly at the moment,
but either choice is fine with me. If no concensus can be reached
on this, then we'll revert to the original behavior.
2. Commit Jerome's patch which implements the decision from (1),
letting a more elaborate handling of environment variables
as a followup patch for someone more involved in cygwin than
we are.
Thanks,
--
Joel
^ permalink raw reply [flat|nested] 59+ messages in thread* Re: [RFA/mingw32] environment variables are case-insensitive on win32
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:35 ` Jerome Guitton
1 sibling, 1 reply; 59+ messages in thread
From: Corinna Vinschen @ 2012-12-10 15:24 UTC (permalink / raw)
To: gdb-patches
On Dec 10 17:49, Joel Brobecker wrote:
> > No, it's not. The Windows environment is NOT case insensitive, it's
> > case-preserving. That's a big difference. A process inherits the
> > environment in exactly the same case as has been used by its parent.
>
> I would like to pause this discussion about cygwin for a second,
> here: I am concerned that we are slowly allowing ourselves to
> hold Jerome's patch, which works on MinGW, because it does not fix
> the problem on cygwin.
>
> Jerome is happy to try to help if it's not too time consuming,
> but it is starting to look like things are far from simple in
> this case.
>
> This is why I propose we do 2 things:
>
> 1. Decide whether we want GDB to match environment variable names
> using case-sensitive or case-insensentive functions on cygwin.
> Right now, it's case-sensitive.
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.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 15:24 ` Corinna Vinschen
@ 2012-12-10 15:42 ` Jerome Guitton
2012-12-10 15:58 ` Corinna Vinschen
0 siblings, 1 reply; 59+ messages in thread
From: Jerome Guitton @ 2012-12-10 15:42 UTC (permalink / raw)
To: gdb-patches
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
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 15:42 ` Jerome Guitton
@ 2012-12-10 15:58 ` Corinna Vinschen
2012-12-10 16:08 ` Jerome Guitton
` (2 more replies)
0 siblings, 3 replies; 59+ messages in thread
From: Corinna Vinschen @ 2012-12-10 15:58 UTC (permalink / raw)
To: gdb-patches
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 don't have GDB test environment set up, but this works for me with the
most recent Cygwin version 1.7.18:
tcsh$ setenv TEST_GDB_V 1
tcsh$ setenv TEST_GDB_v 2
tcsh$ gdb /bin/env
GNU gdb (GDB) 7.5.50.20120815-cvs (cygwin-special)
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-cygwin".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /bin/env...(no debugging symbols found)...done.
(gdb) r
Starting program: /bin/env
[New Thread 1552.0xe24]
[New Thread 1552.0x9c8]
ALLUSERSPROFILE=C:\ProgramData
[...]
TEST_GDB_V=1
TEST_GDB_v=2
[...]
[Inferior 1 (process 1552) exited normally]
(gdb)
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
^ permalink raw reply [flat|nested] 59+ messages in thread* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 15:58 ` Corinna Vinschen
@ 2012-12-10 16:08 ` Jerome Guitton
2012-12-10 16:09 ` Eli Zaretskii
2012-12-11 14:25 ` Pedro Alves
2 siblings, 0 replies; 59+ messages in thread
From: Jerome Guitton @ 2012-12-10 16:08 UTC (permalink / raw)
To: gdb-patches
Corinna Vinschen (vinschen@redhat.com):
> 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!
Not so old actually, this is 1.7.9.
> I don't have GDB test environment set up, but this works for me with the
> most recent Cygwin version 1.7.18.
Probably something wrong in my setup then. So the last patch that I
submitted (today) is the proper one.
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
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-11 14:25 ` Pedro Alves
2 siblings, 1 reply; 59+ messages in thread
From: Eli Zaretskii @ 2012-12-10 16:09 UTC (permalink / raw)
To: gdb-patches
> Date: Mon, 10 Dec 2012 16:57:52 +0100
> From: Corinna Vinschen <vinschen@redhat.com>
>
> 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 don't have GDB test environment set up, but this works for me with the
> most recent Cygwin version 1.7.18:
If some versions of Cygwin are case-insensitive in this context, while
others aren't, then a run-time test of the kind coded by Jerome is
_exactly_ the Right Thing.
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
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
0 siblings, 2 replies; 59+ messages in thread
From: Corinna Vinschen @ 2012-12-10 16:17 UTC (permalink / raw)
To: gdb-patches
On Dec 10 18:09, Eli Zaretskii wrote:
> > Date: Mon, 10 Dec 2012 16:57:52 +0100
> > From: Corinna Vinschen <vinschen@redhat.com>
> >
> > 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 don't have GDB test environment set up, but this works for me with the
> > most recent Cygwin version 1.7.18:
>
> If some versions of Cygwin are case-insensitive in this context, while
> others aren't, then a run-time test of the kind coded by Jerome is
> _exactly_ the Right Thing.
These old versions are not at all supported anymore. The right thing to
do in this case is update.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 16:17 ` Corinna Vinschen
@ 2012-12-10 16:24 ` Jerome Guitton
2012-12-10 16:24 ` Eli Zaretskii
1 sibling, 0 replies; 59+ messages in thread
From: Jerome Guitton @ 2012-12-10 16:24 UTC (permalink / raw)
To: gdb-patches
Corinna Vinschen (vinschen@redhat.com):
> > If some versions of Cygwin are case-insensitive in this context, while
> > others aren't, then a run-time test of the kind coded by Jerome is
> > _exactly_ the Right Thing.
>
> These old versions are not at all supported anymore. The right thing to
> do in this case is update.
A run-time test would do no harm :)
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
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
1 sibling, 1 reply; 59+ messages in thread
From: Eli Zaretskii @ 2012-12-10 16:24 UTC (permalink / raw)
To: gdb-patches
> Date: Mon, 10 Dec 2012 17:17:10 +0100
> From: Corinna Vinschen <vinschen@redhat.com>
>
> > If some versions of Cygwin are case-insensitive in this context, while
> > others aren't, then a run-time test of the kind coded by Jerome is
> > _exactly_ the Right Thing.
>
> These old versions are not at all supported anymore. The right thing to
> do in this case is update.
Why is requiring users to upgrade more reasonable than half a dozen
lines of simple code?
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 16:24 ` Eli Zaretskii
@ 2012-12-10 16:57 ` Corinna Vinschen
2012-12-10 20:11 ` Eli Zaretskii
0 siblings, 1 reply; 59+ messages in thread
From: Corinna Vinschen @ 2012-12-10 16:57 UTC (permalink / raw)
To: gdb-patches
On Dec 10 18:24, Eli Zaretskii wrote:
> > Date: Mon, 10 Dec 2012 17:17:10 +0100
> > From: Corinna Vinschen <vinschen@redhat.com>
> >
> > > If some versions of Cygwin are case-insensitive in this context, while
> > > others aren't, then a run-time test of the kind coded by Jerome is
> > > _exactly_ the Right Thing.
> >
> > These old versions are not at all supported anymore. The right thing to
> > do in this case is update.
>
> Why is requiring users to upgrade more reasonable than half a dozen
> lines of simple code?
Old, unsupported. What you do by adding these tests and special cases
is to complicate the tests and add potential bugs for no good reason.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 16:57 ` Corinna Vinschen
@ 2012-12-10 20:11 ` Eli Zaretskii
2012-12-11 10:20 ` Corinna Vinschen
0 siblings, 1 reply; 59+ messages in thread
From: Eli Zaretskii @ 2012-12-10 20:11 UTC (permalink / raw)
To: gdb-patches
> Date: Mon, 10 Dec 2012 17:57:27 +0100
> From: Corinna Vinschen <vinschen@redhat.com>
>
> On Dec 10 18:24, Eli Zaretskii wrote:
> > > Date: Mon, 10 Dec 2012 17:17:10 +0100
> > > From: Corinna Vinschen <vinschen@redhat.com>
> > >
> > > > If some versions of Cygwin are case-insensitive in this context, while
> > > > others aren't, then a run-time test of the kind coded by Jerome is
> > > > _exactly_ the Right Thing.
> > >
> > > These old versions are not at all supported anymore. The right thing to
> > > do in this case is update.
> >
> > Why is requiring users to upgrade more reasonable than half a dozen
> > lines of simple code?
>
> Old, unsupported. What you do by adding these tests and special cases
> is to complicate the tests and add potential bugs for no good reason.
Again, we are talking about short and straightforward code. Nowhere
near any danger of complicating things and adding bugs. Since when do
we fear adding a bunch of string comparison lines?
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 20:11 ` Eli Zaretskii
@ 2012-12-11 10:20 ` Corinna Vinschen
0 siblings, 0 replies; 59+ messages in thread
From: Corinna Vinschen @ 2012-12-11 10:20 UTC (permalink / raw)
To: gdb-patches
On Dec 10 22:10, Eli Zaretskii wrote:
> > Date: Mon, 10 Dec 2012 17:57:27 +0100
> > From: Corinna Vinschen <vinschen@redhat.com>
> >
> > On Dec 10 18:24, Eli Zaretskii wrote:
> > > > Date: Mon, 10 Dec 2012 17:17:10 +0100
> > > > From: Corinna Vinschen <vinschen@redhat.com>
> > > >
> > > > > If some versions of Cygwin are case-insensitive in this context, while
> > > > > others aren't, then a run-time test of the kind coded by Jerome is
> > > > > _exactly_ the Right Thing.
> > > >
> > > > These old versions are not at all supported anymore. The right thing to
> > > > do in this case is update.
> > >
> > > Why is requiring users to upgrade more reasonable than half a dozen
> > > lines of simple code?
> >
> > Old, unsupported. What you do by adding these tests and special cases
> > is to complicate the tests and add potential bugs for no good reason.
>
> Again, we are talking about short and straightforward code. Nowhere
> near any danger of complicating things and adding bugs. Since when do
> we fear adding a bunch of string comparison lines?
It's just my opinion. You apparently have another one. I'm not in
charge of the code, so do as you see fit.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 15:58 ` Corinna Vinschen
2012-12-10 16:08 ` Jerome Guitton
2012-12-10 16:09 ` Eli Zaretskii
@ 2012-12-11 14:25 ` Pedro Alves
2012-12-11 14:41 ` Corinna Vinschen
2012-12-14 10:35 ` Jerome Guitton
2 siblings, 2 replies; 59+ messages in thread
From: Pedro Alves @ 2012-12-11 14:25 UTC (permalink / raw)
To: gdb-patches
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
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-11 14:25 ` Pedro Alves
@ 2012-12-11 14:41 ` Corinna Vinschen
2012-12-11 15:07 ` Pedro Alves
2012-12-14 10:35 ` Jerome Guitton
1 sibling, 1 reply; 59+ messages in thread
From: Corinna Vinschen @ 2012-12-11 14:41 UTC (permalink / raw)
To: gdb-patches
On Dec 11 14:25, Pedro Alves wrote:
> On 12/10/2012 03:57 PM, Corinna Vinschen wrote:
> > 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?
I phrased my reply too simple, sorry! What happens is this:
Internally, Cygwin doesn't use the Windows environment, but rather a
POSIX equivalent. When a Cygwin process forks or executes another
Cygwin process, the environment is given to the child process in the
POSIXified layout, not using the CreateProcess environment pointer.
However, when a Cygwin process gets started by a *non*-Cygwin process,
this internal mechanism can't work, and the POSIX environment is created
from the Windows environment. Up until 2008, all environment variables
in the Windows env were converted to uppercase when creating the POSIX
env. In 2008 we changed that mechanism to uppercase only a certain set
of env vars, and that's done up to today for compatibility reasons. The
list of still uppercased vars is this:
ALLUSERSPROFILE
COMMONPROGRAMFILES
COMPUTERNAME
COMSPEC
HOME
HOMEDRIVE
HOMEPATH
NUMBER_OF_PROCESSORS
OS
PATH
PATHEXT
PROCESSOR_ARCHITECTURE
PROCESSOR_IDENTIFIER
PROCESSOR_LEVEL
PROCESSOR_REVISION
PROGRAMFILES
SYSTEMDRIVE
SYSTEMROOT
TEMP
TERM
TMP
TMPDIR
WINDIR
Hope that clarifies the situation.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
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
0 siblings, 2 replies; 59+ messages in thread
From: Pedro Alves @ 2012-12-11 15:07 UTC (permalink / raw)
To: gdb-patches
On 12/11/2012 02:40 PM, Corinna Vinschen wrote:
> I phrased my reply too simple, sorry! What happens is this:
Thanks! This clarifies things for me. One follow-up FAOD-like question
below.
> Internally, Cygwin doesn't use the Windows environment, but rather a
> POSIX equivalent. When a Cygwin process forks or executes another
> Cygwin process, the environment is given to the child process in the
> POSIXified layout, not using the CreateProcess environment pointer.
>
> However, when a Cygwin process gets started by a *non*-Cygwin process,
> this internal mechanism can't work, and the POSIX environment is created
> from the Windows environment. Up until 2008, all environment variables
> in the Windows env were converted to uppercase when creating the POSIX
> env. In 2008 we changed that mechanism to uppercase only a certain set
> of env vars, and that's done up to today for compatibility reasons. The
> list of still uppercased vars is this:
>
> ALLUSERSPROFILE
> COMMONPROGRAMFILES
> COMPUTERNAME
> COMSPEC
> HOME
> HOMEDRIVE
> HOMEPATH
> NUMBER_OF_PROCESSORS
> OS
> PATH
> PATHEXT
> PROCESSOR_ARCHITECTURE
> PROCESSOR_IDENTIFIER
> PROCESSOR_LEVEL
> PROCESSOR_REVISION
> PROGRAMFILES
> SYSTEMDRIVE
> SYSTEMROOT
> TEMP
> TERM
> TMP
> TMPDIR
> WINDIR
Then, the situation of GDB (a Cygwin process) starting the inferior with
CreateProcess ends up being the same as if GDB was not a Cygwin process, and
that set of vars always ends up uppercased in the inferior, right? Or does
Cygwin have some magic that detects the case, and avoids the uppercasing in
this case?
--
Pedro Alves
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-11 15:07 ` Pedro Alves
@ 2012-12-11 15:21 ` Corinna Vinschen
2012-12-11 15:23 ` Pierre Muller
1 sibling, 0 replies; 59+ messages in thread
From: Corinna Vinschen @ 2012-12-11 15:21 UTC (permalink / raw)
To: gdb-patches
On Dec 11 15:06, Pedro Alves wrote:
> Then, the situation of GDB (a Cygwin process) starting the inferior with
> CreateProcess ends up being the same as if GDB was not a Cygwin process, and
> that set of vars always ends up uppercased in the inferior, right?
Right. If a Cygwin process uses CreateProcess (rather than fork or
execve) to start another Cygwin process, it's the same as if the
child process had bneen started from a non-Cygwin process.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
^ permalink raw reply [flat|nested] 59+ messages in thread
* RE: [RFA/mingw32] environment variables are case-insensitive on win32
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
1 sibling, 1 reply; 59+ messages in thread
From: Pierre Muller @ 2012-12-11 15:23 UTC (permalink / raw)
To: 'Pedro Alves', gdb-patches
> > However, when a Cygwin process gets started by a *non*-Cygwin process,
> > this internal mechanism can't work, and the POSIX environment is created
> > from the Windows environment. Up until 2008, all environment variables
> > in the Windows env were converted to uppercase when creating the POSIX
> > env. In 2008 we changed that mechanism to uppercase only a certain set
> > of env vars, and that's done up to today for compatibility reasons. The
> > list of still uppercased vars is this:
> >
> > ALLUSERSPROFILE
> > COMMONPROGRAMFILES
> > COMPUTERNAME
> > COMSPEC
> > HOME
> > HOMEDRIVE
> > HOMEPATH
> > NUMBER_OF_PROCESSORS
> > OS
> > PATH
This explains why Cygwin doesn't show the same problem
as mingw does.
You never end up have Path variable...
> > PATHEXT
> > PROCESSOR_ARCHITECTURE
> > PROCESSOR_IDENTIFIER
> > PROCESSOR_LEVEL
> > PROCESSOR_REVISION
> > PROGRAMFILES
> > SYSTEMDRIVE
> > SYSTEMROOT
> > TEMP
> > TERM
> > TMP
> > TMPDIR
> > WINDIR
>
> Then, the situation of GDB (a Cygwin process) starting the inferior with
> CreateProcess ends up being the same as if GDB was not a Cygwin process, and
> that set of vars always ends up uppercased in the inferior, right? Or does
> Cygwin have some magic that detects the case, and avoids the uppercasing in
> this case?
Coming back to the mingw32 case,
currently you can perfectly pass both Path and PATH environment variables to debuggee.
If this debuggee is cmd.exe, the funny thing is that it will use
the value of Path rather than that of PATH ....
Let me show to you:
(gdb) file cmd.exe (output suppressed)
(gdb) set env PATH=e:\pas\svnbin
(gdb) set env Path=c:\windows\system32
(gdb) run
e:\
set
lists both Path and PATH
...lines suppressed
OS=Windows_NT
Path=c:\windows\system32
PATH=e:\pas\svnbin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
...lines suppressed
but
svn.exe (present in e:\pas\svnbin)
is not found...
%PATH%\svn.exe
also doesn't work, because cmd.exe
expands %PATH% to the value of Path variable...
Isn't this all strange...
Pierre
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-11 15:23 ` Pierre Muller
@ 2012-12-14 10:55 ` Jerome Guitton
0 siblings, 0 replies; 59+ messages in thread
From: Jerome Guitton @ 2012-12-14 10:55 UTC (permalink / raw)
To: Pierre Muller; +Cc: 'Pedro Alves', gdb-patches
Pierre Muller (pierre.muller@ics-cnrs.unistra.fr):
> Coming back to the mingw32 case,
> currently you can perfectly pass both Path and PATH environment variables to debuggee.
> If this debuggee is cmd.exe, the funny thing is that it will use
> the value of Path rather than that of PATH ....
Even worse: 'set' would list the two variables, but if you do 'echo
%PATH%' or 'echo %Path%' you'll get the same value (the first one in
the list of environment variables, apparently):
c:\home\guitton\GIT\GDB\builds> set
[...]
PATH=C:\cygwin\bin
Path=C:\windows\system32
[...]
c:\home\guitton\GIT\GDB\builds> echo %PATH%
C:\cygwin\bin
c:\home\guitton\GIT\GDB\builds> echo %Path%
C:\cygwin\bin
My feeling is that all sort of strange things can happen if we do not
assume case-insensitivity in the context of mingw32, so we'd better
stick to it. What do you think?
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-11 14:25 ` Pedro Alves
2012-12-11 14:41 ` Corinna Vinschen
@ 2012-12-14 10:35 ` Jerome Guitton
1 sibling, 0 replies; 59+ messages in thread
From: Jerome Guitton @ 2012-12-14 10:35 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
Pedro Alves (palves@redhat.com):
> 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
>
> ?
I confirm.
> 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.
Agreed.
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 13:50 ` Joel Brobecker
2012-12-10 15:24 ` Corinna Vinschen
@ 2012-12-10 15:35 ` Jerome Guitton
2012-12-10 16:09 ` Pierre Muller
[not found] ` <002401cdd6f0$c0b317b0$42194710$%muller@ics-cnrs.unistra.fr>
1 sibling, 2 replies; 59+ messages in thread
From: Jerome Guitton @ 2012-12-10 15:35 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]
Joel Brobecker (brobecker@adacore.com):
> 1. Decide whether we want GDB to match environment variable names
> using case-sensitive or case-insensentive functions on cygwin.
> Right now, it's case-sensitive. FWIW, we are offering to change
> that behavior, and it seems more user-friencly at the moment,
> but either choice is fine with me. If no concensus can be reached
> on this, then we'll revert to the original behavior.
>
> 2. Commit Jerome's patch which implements the decision from (1),
> letting a more elaborate handling of environment variables
> as a followup patch for someone more involved in cygwin than
> we are.
At this point my feeling is that there is something to clarify for
Cygwin; the symptom being that the new test I submitted for
testenv.exp fails on this platform. But for the moment I'd be inclined
to let Cygwin's situation unchanged and let an expert handle it. The patch
that I would submit would fix mingw32 only. So I guess that would be (2).
The corresponding patch is in attachment.
[-- Attachment #2: environ.c.diff --]
[-- Type: text/x-diff, Size: 2483 bytes --]
commit 65a7d48d6ae3835fb63d2a7c6a40feee16572d95
Author: Jerome Guitton <guitton@adacore.com>
Date: Thu May 24 18:19:23 2012 +0200
environment variables are case-insensitive on mingw
gdb/ChangeLog:
* environ.c (host_has_case_sensitive_env_vars)
(env_var_name_ncmp): New functions.
(get_in_environ, set_in_environ, unset_in_environ): Use
env_var_name_ncmp instead of strncmp.
diff --git a/gdb/environ.c b/gdb/environ.c
index 33426eb..98d8ca6 100644
--- a/gdb/environ.c
+++ b/gdb/environ.c
@@ -96,6 +96,48 @@ environ_vector (struct gdb_environ *e)
return e->vector;
}
\f
+
+/* Return 1 if the names of environ variables are case sensitive
+ on host. */
+
+static int
+host_has_case_sensitive_env_vars()
+{
+ static int result = -1;
+ char *value;
+
+ if (result != -1)
+ return result;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ putenv ("__GDB_TEST_CASE_SENSITIVITY=set");
+
+#else
+ setenv ("__GDB_TEST_CASE_SENSITIVITY", "set", 1);
+#endif
+
+ value = getenv ("__GDB_test_CASE_Sensitivity");
+
+ if (value && (strcmp (value, "set") == 0))
+ result = 0;
+ else
+ result = 1;
+
+ return result;
+}
+
+/* Compare the first LENGTH characters of the names of two
+ environment variable A and B. */
+
+static int
+env_var_name_ncmp(const char *a, const char *b, int length)
+{
+ if (host_has_case_sensitive_env_vars())
+ return strncmp(a, b, length);
+ else
+ return strncasecmp (a, b, length);
+}
+
/* Return the value in environment E of variable VAR. */
char *
@@ -106,7 +148,7 @@ get_in_environ (const struct gdb_environ *e, const char *var)
char *s;
for (; (s = *vector) != NULL; vector++)
- if (strncmp (s, var, len) == 0 && s[len] == '=')
+ if (env_var_name_ncmp (s, var, len) == 0 && s[len] == '=')
return &s[len + 1];
return 0;
@@ -123,7 +165,7 @@ set_in_environ (struct gdb_environ *e, const char *var, const char *value)
char *s;
for (i = 0; (s = vector[i]) != NULL; i++)
- if (strncmp (s, var, len) == 0 && s[len] == '=')
+ if (env_var_name_ncmp (s, var, len) == 0 && s[len] == '=')
break;
if (s == 0)
@@ -170,7 +212,7 @@ unset_in_environ (struct gdb_environ *e, char *var)
for (; (s = *vector) != NULL; vector++)
{
- if (strncmp (s, var, len) == 0 && s[len] == '=')
+ if (env_var_name_ncmp (s, var, len) == 0 && s[len] == '=')
{
xfree (s);
/* Walk through the vector, shuffling args down by one, including
^ permalink raw reply [flat|nested] 59+ messages in thread* RE: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 15:35 ` Jerome Guitton
@ 2012-12-10 16:09 ` Pierre Muller
2012-12-10 16:18 ` 'Jerome Guitton'
[not found] ` <002401cdd6f0$c0b317b0$42194710$%muller@ics-cnrs.unistra.fr>
1 sibling, 1 reply; 59+ messages in thread
From: Pierre Muller @ 2012-12-10 16:09 UTC (permalink / raw)
To: 'Jerome Guitton'; +Cc: gdb-patches
I am not sure, but I have the impression that
the case_preserving environment of Windows OS
is more a shell issue than an OS issue.
The current implementation of native windows compiled with
mingw32 seems to be perfectly able to pass
several different environment variables having the same uppercase name,
see below:
E:\pas\trunk\fpcsrc\rtl>gdbpurepython gdbpurepython
Python Exception <type 'exceptions.ImportError'> No module named gdb:
warning: Could not load the Python gdb module from
`e:\mingw\share\gdb/python'.
warning: Limited Python support is available from the _gdb module.
GNU gdb (GDB) 7.5.50.20121210-cvs
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
e:\pas\fpc-2.6.0\bin\i386-Win32\gdbpurepython.exe...done.
(gdb) set Test1=Mixed
No symbol "Test1" in current context.
(gdb) set env Test1=Mixed
(gdb) set env test1=lower
(gdb) set env TEST1=UPPER
(gdb) set prompt top>
top> r
Starting program: e:\pas\fpc-2.6.0\bin\i386-Win32\gdbpurepython.exe
... Some output suppressed
(gdb) [New Thread 5920.0xb04]
[New Thread 5920.0x1588]
show env
ALLUSERSPROFILE=C:\ProgramData
... More output suppressed
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
RoxioCentral=C:\Program Files (x86)\Common Files\Roxio Shared\10.0\Roxio
Central36\
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\Pierre\AppData\Local\Temp
test1=lower
Test1=Mixed
TEST1=UPPER
... More output suppressed
All three versions are passed successfully to child,
so I don't really understand why we want to remove that possibility
of passing different case versions of the same uppercase'd name.
It's only if I use
set Test1=Mixed
set TEST1=UPPER
and
set
on the windows console
that I do get only a unique line
Test1=UPPER
So that seems to me to be a feature of cmd.exe (or command.com)
more than from the Windows API...
Pierre Muller
GDB pascal language maintainer
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Jerome Guitton
> Envoyé : lundi 10 décembre 2012 16:35
> À : Joel Brobecker
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFA/mingw32] environment variables are case-insensitive on
> win32
>
> Joel Brobecker (brobecker@adacore.com):
>
> > 1. Decide whether we want GDB to match environment variable names
> > using case-sensitive or case-insensentive functions on cygwin.
> > Right now, it's case-sensitive. FWIW, we are offering to change
> > that behavior, and it seems more user-friencly at the moment,
> > but either choice is fine with me. If no concensus can be reached
> > on this, then we'll revert to the original behavior.
> >
> > 2. Commit Jerome's patch which implements the decision from (1),
> > letting a more elaborate handling of environment variables
> > as a followup patch for someone more involved in cygwin than
> > we are.
>
> At this point my feeling is that there is something to clarify for
> Cygwin; the symptom being that the new test I submitted for
> testenv.exp fails on this platform. But for the moment I'd be inclined
> to let Cygwin's situation unchanged and let an expert handle it. The patch
> that I would submit would fix mingw32 only. So I guess that would be (2).
>
> The corresponding patch is in attachment.
>
>
>
^ permalink raw reply [flat|nested] 59+ messages in thread* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 16:09 ` Pierre Muller
@ 2012-12-10 16:18 ` 'Jerome Guitton'
2012-12-10 16:27 ` Pierre Muller
2012-12-11 16:27 ` Christopher Faylor
0 siblings, 2 replies; 59+ messages in thread
From: 'Jerome Guitton' @ 2012-12-10 16:18 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
Pierre Muller (pierre.muller@ics-cnrs.unistra.fr):
> I am not sure, but I have the impression that the case_preserving
> environment of Windows OS is more a shell issue than an OS issue.
I don't think so, because I see the same problem by using "set env"
from GDB. But it does not matter much. I am now convinced that my
setup is to blame. So I'm happy to withdraw the Cygwin-specific part
of my patch.
^ permalink raw reply [flat|nested] 59+ messages in thread
* RE: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 16:18 ` 'Jerome Guitton'
@ 2012-12-10 16:27 ` Pierre Muller
2012-12-10 16:54 ` Corinna Vinschen
2012-12-11 16:27 ` Christopher Faylor
1 sibling, 1 reply; 59+ messages in thread
From: Pierre Muller @ 2012-12-10 16:27 UTC (permalink / raw)
To: 'Jerome Guitton'; +Cc: gdb-patches
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de 'Jerome Guitton'
> Envoyé : lundi 10 décembre 2012 17:19
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFA/mingw32] environment variables are case-insensitive on
> win32
>
> Pierre Muller (pierre.muller@ics-cnrs.unistra.fr):
>
> > I am not sure, but I have the impression that the case_preserving
> > environment of Windows OS is more a shell issue than an OS issue.
>
> I don't think so, because I see the same problem by using "set env"
> from GDB. But it does not matter much. I am now convinced that my
> setup is to blame. So I'm happy to withdraw the Cygwin-specific part
> of my patch.
But my email was not about the cygwin part,
it was really about the mingw executable:
Currently, you can set several separate environment variables
having the same upeercase'd name, which
can be passed correctly to the debuggee.
But after your patch, this will not be possible anymore,
and I don't think that adding restrictions to GDB is something I like.
Note that this is independent of the issue to know whether msvcrt dll
allows this also or not...
I would at least want to be able to accept and keep separate variables
with the same uppercase'd name with some option,
something like
set windows case-sensitive-environment
I don't care if the default is to merge them,
but I really want to preserve a possibility that
might be useful for specific executables...
Pierre Muller
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 16:27 ` Pierre Muller
@ 2012-12-10 16:54 ` Corinna Vinschen
2012-12-10 18:22 ` Jerome Guitton
0 siblings, 1 reply; 59+ messages in thread
From: Corinna Vinschen @ 2012-12-10 16:54 UTC (permalink / raw)
To: gdb-patches
On Dec 10 17:26, Pierre Muller wrote:
>
>
> > -----Message d'origine-----
> > De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> > owner@sourceware.org] De la part de 'Jerome Guitton'
> > Envoyé : lundi 10 décembre 2012 17:19
> > ÃÂ : Pierre Muller
> > Cc : gdb-patches@sourceware.org
> > Objet : Re: [RFA/mingw32] environment variables are case-insensitive on
> > win32
> >
> > Pierre Muller (pierre.muller@ics-cnrs.unistra.fr):
> >
> > > I am not sure, but I have the impression that the case_preserving
> > > environment of Windows OS is more a shell issue than an OS issue.
> >
> > I don't think so, because I see the same problem by using "set env"
> > from GDB. But it does not matter much. I am now convinced that my
> > setup is to blame. So I'm happy to withdraw the Cygwin-specific part
> > of my patch.
>
> But my email was not about the cygwin part,
> it was really about the mingw executable:
> Currently, you can set several separate environment variables
> having the same upeercase'd name, which
> can be passed correctly to the debuggee.
Just as a data point:
Only the Win32 function GetEnviromentVariable searches the environment
case-insensitive, and SetEnviromentVariable overwrites the first
occurence of a variable after a case-insensitive search. These
functions are also used by CMD.EXE, so that it's case-insensitive as
well.
But that doesn't affect the ability to handle case-sensitive environments
in applications NOT using GetEnviromentVariable/SetEnviromentVariable.
If you give an environment to the CreateProcess function it will go
unchanged to the inferior process. Fetching the complete environment
with GetEnvironmentStrings in the inferior will show the full,
unchanged, environment, with as much variables only differing by case as
you like.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 16:54 ` Corinna Vinschen
@ 2012-12-10 18:22 ` Jerome Guitton
2012-12-10 18:35 ` Pierre Muller
0 siblings, 1 reply; 59+ messages in thread
From: Jerome Guitton @ 2012-12-10 18:22 UTC (permalink / raw)
To: gdb-patches
Corinna Vinschen (vinschen@redhat.com):
> Only the Win32 function GetEnviromentVariable searches the environment
> case-insensitive, and SetEnviromentVariable overwrites the first
> occurence of a variable after a case-insensitive search. These
> functions are also used by CMD.EXE, so that it's case-insensitive as
> well.
>
> But that doesn't affect the ability to handle case-sensitive environments
> in applications NOT using GetEnviromentVariable/SetEnviromentVariable.
>
> If you give an environment to the CreateProcess function it will go
> unchanged to the inferior process. Fetching the complete environment
> with GetEnvironmentStrings in the inferior will show the full,
> unchanged, environment, with as much variables only differing by case as
> you like.
Thank you very much for this clarification Corinna!
At this point I feel that the most sensible thing to do for mingw32 is
to have case-insensitive env vars, even though on certain
circonstances case-sensitivity would work. I have one other good
reason to think that: the path command does not work today in mingw32
when running the debugger from CMD.EXE. That is caused by the fact the
corresponding environment variable has a different casing than PATH:
it's 'Path' (at least on my machine). So a case-sensitive lookup
fails, a new variable 'PATH' is created in the environment vector, and
the inferior ends up with a truncated environment.
^ permalink raw reply [flat|nested] 59+ messages in thread
* RE: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 18:22 ` Jerome Guitton
@ 2012-12-10 18:35 ` Pierre Muller
2012-12-10 18:36 ` 'Jerome Guitton'
0 siblings, 1 reply; 59+ messages in thread
From: Pierre Muller @ 2012-12-10 18:35 UTC (permalink / raw)
To: 'Jerome Guitton', gdb-patches
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Jerome Guitton
> Envoyé : lundi 10 décembre 2012 19:22
> À : gdb-patches@sourceware.org
> Objet : Re: [RFA/mingw32] environment variables are case-insensitive on
> win32
>
> Corinna Vinschen (vinschen@redhat.com):
>
> > Only the Win32 function GetEnviromentVariable searches the environment
> > case-insensitive, and SetEnviromentVariable overwrites the first
> > occurence of a variable after a case-insensitive search. These
> > functions are also used by CMD.EXE, so that it's case-insensitive as
> > well.
> >
> > But that doesn't affect the ability to handle case-sensitive
environments
> > in applications NOT using GetEnviromentVariable/SetEnviromentVariable.
> >
> > If you give an environment to the CreateProcess function it will go
> > unchanged to the inferior process. Fetching the complete environment
> > with GetEnvironmentStrings in the inferior will show the full,
> > unchanged, environment, with as much variables only differing by case as
> > you like.
>
> Thank you very much for this clarification Corinna!
>
> At this point I feel that the most sensible thing to do for mingw32 is
> to have case-insensitive env vars, even though on certain
> circonstances case-sensitivity would work. I have one other good
> reason to think that: the path command does not work today in mingw32
> when running the debugger from CMD.EXE. That is caused by the fact the
> corresponding environment variable has a different casing than PATH:
> it's 'Path' (at least on my machine). So a case-sensitive lookup
> fails, a new variable 'PATH' is created in the environment vector, and
> the inferior ends up with a truncated environment.
That is strange because when I start a mingw32 compiled GDB executable
from a console
"show env" command does indeed display
Path variable,
but nonetheless GDB is perfectly able to use Path variable...
(gdb) show env
ALLUSERSPROFILE=C:\ProgramData
<<<<Lines removed
OS=Windows_NT
Path=C:\Program Files (x86)\MiKTeX 2.9\miktex\bin;C:\Program Files
(x86)\Windows
Resource Kits\Tools\;C:\Program Files\Common Files\Microsoft Shared\Windows
Liv
e;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System3
2\Wi
ndowsPowerShell\v1.0\;C:\Program Files\Dell\DW WLAN Card;c:\Program
Files\WIDCOM
M\Bluetooth Software\;c:\Program Files\WIDCOMM\Bluetooth
Software\syswow64;C:\Pr
ogram Files (x86)\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program
Fil
es\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Wave
Systems
Corp\Gemalto\Access Client\v5\;C:\Program Files (x86)\Common Files\Roxio
Shared
\DLLShared\;C:\Program Files (x86)\Common Files\Roxio
Shared\10.0\DLLShared\;E:\
pas\svnbin;C:\Program Files\Intel\DMIX;C:\Program Files (x86)\MySQL\MySQL
Server
5.5\bin;e:\pas\fpc-2.6.0\bin\i386-Win32;C:\Program
Files\SlikSvn\bin;C:\Program
Files (x86)\Dr. Memory\bin;C:\Program Files (x86)\PuTTY;C:\Program Files
(x86)\
OpenVPN\bin;C:\Program Files
(x86)\OVPSim\Imperas\bin\Windows32;C:\OVPSim\Impera
s\bin\Windows32
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
<<<<Lines removed
COLUMNS=80
(gdb) file drmemory.exe
Load new symbol table from "C:\Program Files (x86)\Dr.
Memory\bin\drmemory.exe"?
(y or n) y
Reading symbols from C:\Program Files (x86)\Dr.
Memory\bin\drmemory.exe...(no de
bugging symbols found)...done.
I don't know why this doesn't work for you.
Pierre
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 18:35 ` Pierre Muller
@ 2012-12-10 18:36 ` 'Jerome Guitton'
2012-12-11 9:50 ` 'Jerome Guitton'
0 siblings, 1 reply; 59+ messages in thread
From: 'Jerome Guitton' @ 2012-12-10 18:36 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
Pierre Muller (pierre.muller@ics-cnrs.unistra.fr):
> That is strange because when I start a mingw32 compiled GDB executable
> from a console
> "show env" command does indeed display
> Path variable,
> but nonetheless GDB is perfectly able to use Path variable...
Right, but try
(gdb) path C:\
...and you'll see what I mean.
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 18:36 ` 'Jerome Guitton'
@ 2012-12-11 9:50 ` 'Jerome Guitton'
0 siblings, 0 replies; 59+ messages in thread
From: 'Jerome Guitton' @ 2012-12-11 9:50 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
'Jerome Guitton' (guitton@adacore.com):
> Right, but try
>
> (gdb) path C:\
>
> ...and you'll see what I mean.
...or, to better illustrate my point, consider the following scenario:
gdb /cygwin/bin/which.exe
(gdb) r ls
Starting program: C:\cygwin\bin\which.exe ls
/usr/bin/which: no ls in ([...])
(gdb) path C:/cygwin/bin
Executable and object file path: C:/cygwin/bin
(gdb) r ls
Starting program: C:\cygwin\bin\which.exe ls
/usr/bin/which: no ls in ([...])
This is cause by the fact that C:/cygwin/bin has not been added to
'Path'... but to 'PATH'. 'show env PATH' and 'show env Path' give
two different results.
Now, the problem does not occur with case-insentivity:
gdb /cygwin/bin/which.exe
(gdb) r ls
Starting program: C:\cygwin\bin\which.exe ls
/usr/bin/which: no ls in ([...])
(gdb) path C:/cygwin/bin
Executable and object file path: C:/cygwin/bin;[...rest of original PATH]
(gdb) r ls
/usr/bin/ls
Now an alternative solution could be to use 'Path' instead of 'PATH'
in the case of mingw32. That would fix this problem. I tend to think
that having the same behavior as CMD.EXE for mingw32 is the most
reasonable thing to do, though. So case-insentivity.
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 16:18 ` 'Jerome Guitton'
2012-12-10 16:27 ` Pierre Muller
@ 2012-12-11 16:27 ` Christopher Faylor
1 sibling, 0 replies; 59+ messages in thread
From: Christopher Faylor @ 2012-12-11 16:27 UTC (permalink / raw)
To: gdb-patches, Pierre Muller, 'Jerome Guitton'
On Mon, Dec 10, 2012 at 05:18:31PM +0100, 'Jerome Guitton' wrote:
>Pierre Muller:
>>I am not sure, but I have the impression that the case_preserving
>>environment of Windows OS is more a shell issue than an OS issue.
>
>I don't think so, because I see the same problem by using "set env"
>from GDB. But it does not matter much. I am now convinced that my
>setup is to blame. So I'm happy to withdraw the Cygwin-specific part
>of my patch.
Thanks. I think that both Corinna and I (the Cygwin maintainers) agree
that nothing is broken for Cygwin so there is no reason to institute
special handling for it wrt environment variable case sensitivity.
cgf
^ permalink raw reply [flat|nested] 59+ messages in thread
[parent not found: <002401cdd6f0$c0b317b0$42194710$%muller@ics-cnrs.unistra.fr>]
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
[not found] ` <002401cdd6f0$c0b317b0$42194710$%muller@ics-cnrs.unistra.fr>
@ 2012-12-10 16:26 ` Eli Zaretskii
2012-12-10 16:40 ` Pierre Muller
0 siblings, 1 reply; 59+ messages in thread
From: Eli Zaretskii @ 2012-12-10 16:26 UTC (permalink / raw)
To: Pierre Muller; +Cc: guitton, gdb-patches
> From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
> Cc: <gdb-patches@sourceware.org>
> Date: Mon, 10 Dec 2012 17:09:37 +0100
>
> (gdb) set Test1=Mixed
> No symbol "Test1" in current context.
> (gdb) set env Test1=Mixed
> (gdb) set env test1=lower
> (gdb) set env TEST1=UPPER
> (gdb) set prompt top>
> top> r
> Starting program: e:\pas\fpc-2.6.0\bin\i386-Win32\gdbpurepython.exe
> ... Some output suppressed
> (gdb) [New Thread 5920.0xb04]
> [New Thread 5920.0x1588]
> show env
> ALLUSERSPROFILE=C:\ProgramData
> ... More output suppressed
> PROMPT=$P$G
> PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
> PUBLIC=C:\Users\Public
> RoxioCentral=C:\Program Files (x86)\Common Files\Roxio Shared\10.0\Roxio
> Central36\
> SESSIONNAME=Console
> SystemDrive=C:
> SystemRoot=C:\Windows
> TEMP=C:\Users\Pierre\AppData\Local\Temp
> test1=lower
> Test1=Mixed
> TEST1=UPPER
> ... More output suppressed
You _are_ aware that "show env" is a GDB command, right? What you
need to do is run some Windows program after pushing these variables
into the environment, and then see what that problem gets as
environment.
^ permalink raw reply [flat|nested] 59+ messages in thread* RE: [RFA/mingw32] environment variables are case-insensitive on win32
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
0 siblings, 2 replies; 59+ messages in thread
From: Pierre Muller @ 2012-12-10 16:40 UTC (permalink / raw)
To: 'Eli Zaretskii'; +Cc: guitton, gdb-patches
> > (gdb) set prompt top>
> > top> r
> > Starting program: e:\pas\fpc-2.6.0\bin\i386-Win32\gdbpurepython.exe
> > ... Some output suppressed
> > (gdb) [New Thread 5920.0xb04]
> > [New Thread 5920.0x1588]
> > show env
> > ALLUSERSPROFILE=C:\ProgramData
> > ... More output suppressed
> > PROMPT=$P$G
> > PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
> > PUBLIC=C:\Users\Public
> > RoxioCentral=C:\Program Files (x86)\Common Files\Roxio Shared\10.0\Roxio
> > Central36\
> > SESSIONNAME=Console
> > SystemDrive=C:
> > SystemRoot=C:\Windows
> > TEMP=C:\Users\Pierre\AppData\Local\Temp
> > test1=lower
> > Test1=Mixed
> > TEST1=UPPER
> > ... More output suppressed
>
> You _are_ aware that "show env" is a GDB command, right? What you
> need to do is run some Windows program after pushing these variables
> into the environment, and then see what that problem gets as
> environment.
Hi Eli,
I am totally aware of this,
but please note that I run this command in the debuggee
(prompt is (gdb), not top>)
(I should have remoced the [New Thread] information message that probably
confused you)
and GDB itself is a Windows program like any other one,
and the environment is passed from top to debuggee
through the env field of CreateProcess call in windows_create_process
Furthermore compiling testenv.c
$ cat testenv.c
#include "stdio.h"
int
main (int argc, char **argv, char **env)
{
int envindex = 1;
char *curr_env = *env;
while (curr_env)
{
printf("env#%d is %s\n",envindex,curr_env);
curr_env = env [envindex];
envindex++;
}
return 0;
}
also shows the three different versions of test1
Short extract of running testenv inside mingw GDB
after having set the same env variables
env#52 is TEMP=C:/Users/Pierre/AppData/Local/Temp
env#53 is TERM=cygwin
env#54 is test1=lower
env#55 is Test1=Mixed
env#56 is TEST1=UPPER
env#57 is TMP=C:/Users/Pierre/AppData/Local/Temp
env#58 is USERDOMAIN=E6510-Muller
Pierre
^ permalink raw reply [flat|nested] 59+ messages in thread* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 16:40 ` Pierre Muller
@ 2012-12-10 16:51 ` Jerome Guitton
2012-12-10 17:16 ` Jerome Guitton
1 sibling, 0 replies; 59+ messages in thread
From: Jerome Guitton @ 2012-12-10 16:51 UTC (permalink / raw)
To: Pierre Muller; +Cc: 'Eli Zaretskii', gdb-patches
Pierre Muller (pierre.muller@ics-cnrs.unistra.fr):
> Short extract of running testenv inside mingw GDB
> after having set the same env variables
> env#52 is TEMP=C:/Users/Pierre/AppData/Local/Temp
> env#53 is TERM=cygwin
> env#54 is test1=lower
> env#55 is Test1=Mixed
> env#56 is TEST1=UPPER
> env#57 is TMP=C:/Users/Pierre/AppData/Local/Temp
> env#58 is USERDOMAIN=E6510-Muller
Strange... I can only say that I am not having the same
behavior. Windows documentation clearly states that variable names are
not case-sensitive (so that "you can combine uppercase and lowercase
letters in your variable names to make your code more readable", as
they say).
Now, I *guess* that my patch would not change the behavior of GDB in
your case, as the run-time check would return "case sensitive".
That's a guess... Could you try it?
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-12-10 16:40 ` Pierre Muller
2012-12-10 16:51 ` Jerome Guitton
@ 2012-12-10 17:16 ` Jerome Guitton
1 sibling, 0 replies; 59+ messages in thread
From: Jerome Guitton @ 2012-12-10 17:16 UTC (permalink / raw)
To: Pierre Muller; +Cc: 'Eli Zaretskii', gdb-patches
Pierre Muller (pierre.muller@ics-cnrs.unistra.fr):
> $ cat testenv.c
> #include "stdio.h"
>
> int
> main (int argc, char **argv, char **env)
> {
> int envindex = 1;
> char *curr_env = *env;
>
> while (curr_env)
> {
> printf("env#%d is %s\n",envindex,curr_env);
> curr_env = env [envindex];
> envindex++;
> }
> return 0;
> }
Hmm. I can reproduce the problem. I'm thinking that the env vector (as
main's third argument) may be passed to the program by createInferior
without any processing. If you try getenv, I bet that you'll have a
different result.
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 13:37 [RFA/mingw32] environment variables are case-insensitive on win32 Jerome Guitton
2012-11-30 13:47 ` Eli Zaretskii
@ 2012-11-30 14:43 ` Pedro Alves
2012-11-30 15:03 ` Jerome Guitton
1 sibling, 1 reply; 59+ messages in thread
From: Pedro Alves @ 2012-11-30 14:43 UTC (permalink / raw)
To: Jerome Guitton; +Cc: gdb-patches
On 11/30/2012 01:36 PM, Jerome Guitton wrote:
> A patch that I sent a few months ago, I think, but never got in:
> environment variables are case-insensitive on windows, this patch would
> take that into account.
You did. Please look up the previous patch submission, and check if you've
addressed previous comments. ISTR mention of a test.
BTW, this would be more correctly modeled as a target property, not host property.
--
Pedro Alves
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 14:43 ` Pedro Alves
@ 2012-11-30 15:03 ` Jerome Guitton
2012-11-30 15:38 ` Jerome Guitton
0 siblings, 1 reply; 59+ messages in thread
From: Jerome Guitton @ 2012-11-30 15:03 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
Pedro Alves (palves@redhat.com):
> You did. Please look up the previous patch submission, and check if you've
> addressed previous comments. ISTR mention of a test.
Confirmed. I'll provide a test.
> BTW, this would be more correctly modeled as a target property, not
> host property.
Hm, indeed. I'll add a new hook in gdbarch then.
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 15:03 ` Jerome Guitton
@ 2012-11-30 15:38 ` Jerome Guitton
2012-11-30 15:41 ` Pedro Alves
0 siblings, 1 reply; 59+ messages in thread
From: Jerome Guitton @ 2012-11-30 15:38 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
Jerome Guitton (guitton@adacore.com):
> > BTW, this would be more correctly modeled as a target property, not
> > host property.
>
> Hm, indeed. I'll add a new hook in gdbarch then.
Hmm. In theory that would be true, but the problem is that as of today
the environment seems to come from the host: in each inferior record, the
environment field is initialized by make_environment, which gets
it from the host. I cannot find any place where this would be updated
by gdbarch.
Actually, the semantics of the "path" command is not quite clear to me
when host != target. In particular, you usually call it before
creating the inferior...
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 15:38 ` Jerome Guitton
@ 2012-11-30 15:41 ` Pedro Alves
2012-11-30 15:46 ` Tom Tromey
2012-11-30 16:02 ` Jerome Guitton
0 siblings, 2 replies; 59+ messages in thread
From: Pedro Alves @ 2012-11-30 15:41 UTC (permalink / raw)
To: Jerome Guitton; +Cc: gdb-patches
On 11/30/2012 03:38 PM, Jerome Guitton wrote:
> Jerome Guitton (guitton@adacore.com):
>
>>> BTW, this would be more correctly modeled as a target property, not
>>> host property.
>>
>> Hm, indeed. I'll add a new hook in gdbarch then.
>
> Hmm. In theory that would be true, but the problem is that as of today
> the environment seems to come from the host: in each inferior record, the
> environment field is initialized by make_environment, which gets
> it from the host. I cannot find any place where this would be updated
> by gdbarch.
>
> Actually, the semantics of the "path" command is not quite clear to me
> when host != target. In particular, you usually call it before
> creating the inferior...
Indeed. We don't really support these with remote targets yet, so
I'm okay with leaving it host-dependent in the mean time.
--
Pedro Alves
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
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
1 sibling, 1 reply; 59+ messages in thread
From: Tom Tromey @ 2012-11-30 15:46 UTC (permalink / raw)
To: Pedro Alves; +Cc: Jerome Guitton, gdb-patches
Pedro> Indeed. We don't really support these with remote targets yet, so
Pedro> I'm okay with leaving it host-dependent in the mean time.
The background here is:
http://sourceware.org/gdb/wiki/LocalRemoteFeatureParity
It isn't entirely clear to me how remote environment setting ought to
work. Like, when connecting to gdbserver, should gdb send its entire
environment (some of which may be host-specific)? Or should 'set env'
be the only way to change the environment (making 'show env' somewhat
weird?). Or ...?
Tom
^ permalink raw reply [flat|nested] 59+ messages in thread* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 15:46 ` Tom Tromey
@ 2012-11-30 15:49 ` Pedro Alves
0 siblings, 0 replies; 59+ messages in thread
From: Pedro Alves @ 2012-11-30 15:49 UTC (permalink / raw)
To: Tom Tromey; +Cc: Jerome Guitton, gdb-patches
On 11/30/2012 03:46 PM, Tom Tromey wrote:
> Pedro> Indeed. We don't really support these with remote targets yet, so
> Pedro> I'm okay with leaving it host-dependent in the mean time.
>
> The background here is:
>
> http://sourceware.org/gdb/wiki/LocalRemoteFeatureParity
>
> It isn't entirely clear to me how remote environment setting ought to
> work. Like, when connecting to gdbserver, should gdb send its entire
> environment (some of which may be host-specific)? Or should 'set env'
> be the only way to change the environment (making 'show env' somewhat
> weird?). Or ...?
I don't really know as well. Part of addressing the issue is figuring
out those things.
--
Pedro Alves
^ permalink raw reply [flat|nested] 59+ messages in thread
* Re: [RFA/mingw32] environment variables are case-insensitive on win32
2012-11-30 15:41 ` Pedro Alves
2012-11-30 15:46 ` Tom Tromey
@ 2012-11-30 16:02 ` Jerome Guitton
1 sibling, 0 replies; 59+ messages in thread
From: Jerome Guitton @ 2012-11-30 16:02 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
Pedro Alves (palves@redhat.com):
> Indeed. We don't really support these with remote targets yet, so
> I'm okay with leaving it host-dependent in the mean time.
OK; I'll focus on writing a testcase then.
^ permalink raw reply [flat|nested] 59+ messages in thread
end of thread, other threads:[~2012-12-14 10:55 UTC | newest]
Thread overview: 59+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-30 13:37 [RFA/mingw32] environment variables are case-insensitive on win32 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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox