diff options
author | Pierre Muller <muller@sourceware.org> | 2001-11-09 09:46:40 +0000 |
---|---|---|
committer | Pierre Muller <muller@sourceware.org> | 2001-11-09 09:46:40 +0000 |
commit | 94a716bf572725eb2c6517833853a77ca3165362 (patch) | |
tree | 197462f1fca7422c67bd96f358ee5decbc0060e1 /gdb/p-exp.y | |
parent | f6a9480ec1bae59eeacb9c52f5fcf11032ff3594 (diff) | |
download | gdb-94a716bf572725eb2c6517833853a77ca3165362.zip gdb-94a716bf572725eb2c6517833853a77ca3165362.tar.gz gdb-94a716bf572725eb2c6517833853a77ca3165362.tar.bz2 |
2001-11-06 Pierre Muller <muller@ics.u-strasbg.fr>
* p-exp.y (yylex): Only change case of expression if symbol is found.
Also check for GPC standard name form.
Diffstat (limited to 'gdb/p-exp.y')
-rw-r--r-- | gdb/p-exp.y | 54 |
1 files changed, 44 insertions, 10 deletions
diff --git a/gdb/p-exp.y b/gdb/p-exp.y index d786af9..d1fcb1b 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -1299,21 +1299,55 @@ yylex () VAR_NAMESPACE, &is_a_field_of_this, (struct symtab **) NULL); - /* second chance uppercased ! */ + /* second chance uppercased (as Free Pascal does). */ if (!sym) { - for (i = 0;i <= namelen;i++) + for (i = 0; i <= namelen; i++) { - if ((tmp[i]>='a' && tmp[i]<='z')) + if ((tmp[i] >= 'a' && tmp[i] <= 'z')) tmp[i] -= ('a'-'A'); - /* I am not sure that copy_name gives excatly the same result ! */ - if ((tokstart[i]>='a' && tokstart[i]<='z')) - tokstart[i] -= ('a'-'A'); } - sym = lookup_symbol (tmp, expression_context_block, - VAR_NAMESPACE, - &is_a_field_of_this, - (struct symtab **) NULL); + sym = lookup_symbol (tmp, expression_context_block, + VAR_NAMESPACE, + &is_a_field_of_this, + (struct symtab **) NULL); + if (sym) + for (i = 0; i <= namelen; i++) + { + if ((tokstart[i] >= 'a' && tokstart[i] <= 'z')) + tokstart[i] -= ('a'-'A'); + } + } + /* Third chance Capitalized (as GPC does). */ + if (!sym) + { + for (i = 0; i <= namelen; i++) + { + if (i == 0) + { + if ((tmp[i] >= 'a' && tmp[i] <= 'z')) + tmp[i] -= ('a'-'A'); + } + else + if ((tmp[i] >= 'A' && tmp[i] <= 'Z')) + tmp[i] -= ('A'-'a'); + } + sym = lookup_symbol (tmp, expression_context_block, + VAR_NAMESPACE, + &is_a_field_of_this, + (struct symtab **) NULL); + if (sym) + for (i = 0; i <= namelen; i++) + { + if (i == 0) + { + if ((tokstart[i] >= 'a' && tokstart[i] <= 'z')) + tokstart[i] -= ('a'-'A'); + } + else + if ((tokstart[i] >= 'A' && tokstart[i] <= 'Z')) + tokstart[i] -= ('A'-'a'); + } } /* Call lookup_symtab, not lookup_partial_symtab, in case there are no psymtabs (coff, xcoff, or some future change to blow away the |