Re: charset.c problem with non-en_US locales

Jim Blandy
2003-04-24T02:35:46Z

Andrew Cagney <ac131313@redhat.com> writes:
> Hmm,
>
> (gdb) set charset <tab>
>
> doesn't work. If that was fixed (using GDB's enum cli method), the
> command would become case sensitive. Since GDB's CLI is case
> sensative in general that would make sense.

Actually, the CLI is inconsistent:

zenia:jimb$ gdb
GNU gdb 2003-04-17-cvs
Copyright 2003 Free Software Foundation, Inc.
...
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
(gdb) print 0
$1 = 0
(gdb) PRINT 0
$2 = 0
(gdb) PrInT 0
$3 = 0
(gdb)

I would assume that the following code in cli-decode.c:lookup_cmd_1
would have the same problems as the charset stuff in a Turkish locale:

/*
** We didn't find the command in the entered case, so lower case it
** and search again.
*/
if (!found || nfound == 0)
{
for (tmp = 0; tmp < len; tmp++)
{
char x = command[tmp];
command[tmp] = isupper (x) ? tolower (x) : x;
}
found = find_cmd (command, len, clist, ignore_help_classes, &nfound);
}

It seems to me that:
- cli-decode.c should use safe-charset.h,
- the enum code in cli-setshow.c should be changed to be
case-insensitive, using safe-charset.h, and
- charset.c should be changed to use an enum, for completion's sake.