This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] language support: case sensitivity
- To: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Subject: Re: [PATCH] language support: case sensitivity
- From: Jimmy Guo <guo at cup dot hp dot com>
- Date: Thu, 10 Aug 2000 18:07:01 -0700 (PDT)
- Cc: gdb-patches at sourceware dot cygnus dot com
Committed, with changes made to original patch (see below):
On 9 Aug 2000, Jim Blandy wrote:
>
>This is approved, with the following changes:
>
>Scheme is not case-sensitive. R5RS, section 2: "Upper and lower case
>forms of a letter are never distinguished except within character and
>string constants. For example, Foo is the same identifier as FOO, and
>#x1AB is the same number as #X1ab."
>
>In lookup_symbol, please just go ahead and change the value of `name';
>don't change every use of `name' to `copy'. `copy' is a poor variable
>name. If it is necessary to keep the original, unmodified name
>around, keep it in a variable named `original_name'. (But I don't see
>any remaining uses of `name', so I don't think this is necessary.)
Done (see diffs below):
- scm-lang.c: case_sensitive_off
- language.c: change name directly.
>Please update the comment above the call to check_field.
This is not done. Will do so after clarifying with Jim Blandy.
Tested against the latest gdb tree on Linux. No regression, 2 new
passes in gdb.fortran test suite.
Index: scm-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/scm-lang.c,v
retrieving revision 1.3
diff -c -r1.3 scm-lang.c
*** scm-lang.c 2000/07/30 01:48:27 1.3
--- scm-lang.c 2000/08/11 00:05:46
***************
*** 233,238 ****
--- 233,239 ----
c_builtin_types,
range_check_off,
type_check_off,
+ case_sensitive_off,
scm_parse,
c_error,
evaluate_subexp_scm,
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.11
diff -c -r1.11 symtab.c
*** symtab.c 2000/08/04 23:13:50 1.11
--- symtab.c 2000/08/11 00:05:46
***************
*** 584,589 ****
--- 584,602 ----
register struct block *b;
register struct minimal_symbol *msymbol;
+ if (case_sensitivity == case_sensitive_off)
+ {
+ char *copy;
+ int len, i;
+
+ len = strlen (name);
+ copy = (char *) alloca (len + 1);
+ for (i= 0; i < len; i++)
+ copy[i] = tolower (name[i]);
+ copy[len] = 0;
+ name = copy;
+ }
+
/* Search specified block and its superiors. */
while (block != 0)