diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-04-27 20:03:04 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-04-27 20:03:04 +0000 |
commit | 559a7a62019960bacbbe4b099f3c7926352cb131 (patch) | |
tree | 612e31c7864fb3ef5cc4c477f3633c4a7da0579e /gdb/symtab.c | |
parent | 681bf369ead4c4264cc9fcc8ba603cb06e7c2994 (diff) | |
download | gdb-559a7a62019960bacbbe4b099f3c7926352cb131.zip gdb-559a7a62019960bacbbe4b099f3c7926352cb131.tar.gz gdb-559a7a62019960bacbbe4b099f3c7926352cb131.tar.bz2 |
gdb/doc/
* gdb.texinfo (Index Section Format): Change the version to 5.
Describe the different formula.
gdb/
Case insensitive lookups implementation.
* dwarf2read.c: Include ctype.h.
(struct mapped_index): New field version.
(mapped_index_string_hash): New parameter index_version. New comment
for it. Call tolower appropriately.
(find_slot_in_mapped_hash): New variable cmp, initialize it, use it.
Choose the right index version for mapped_index_string_hash.
(dwarf2_read_index): Support also the index version 5. Initialize the
new struct mapped_index field version.
(hash_strtab_entry): Pass INT_MAX for the new parameter, explain why.
(find_slot): Explain the version needs. Pass INT_MAX for the new
parameter.
(write_psymtabs_to_index): Produce version 5.
* minsyms.c (lookup_minimal_symbol): New variable cmp, initialize it,
use it. New comment for SYMBOL_MATCHES_SEARCH_NAME.
* psymtab.c (lookup_partial_symbol): Find the
SYMBOL_MATCHES_SEARCH_NAME start of the found block of matching
entries.
* symtab.c (lookup_symbol_in_language): Remove the case_sensitive_off
NAME lowercasing.
(search_symbols): Pass REG_ICASE to regcomp for case_sensitive_off.
(completion_list_add_name): New variable ncmp, initialize it, use it.
* symtab.h (SYMBOL_HASH_NEXT): Always call tolower.
* utils.c (strcmp_iw): Support case_sensitive_off.
(strcmp_iw_ordered): Sort in a way compatible with case_sensitive_off.
New function comment part. New variables saved_string1,
saved_string2 and case_pass. Add a proper second pass.
gdb/testsuite/
* gdb.base/fortran-sym-case.c: New file.
* gdb.base/fortran-sym-case.exp: New file.
* gdb.dwarf2/dw2-case-insensitive-debug.S: New file.
* gdb.dwarf2/dw2-case-insensitive.c: New file.
* gdb.dwarf2/dw2-case-insensitive.exp: New file.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index ebc8221..f9e2bca 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1056,19 +1056,6 @@ lookup_symbol_in_language (const char *name, const struct block *block, } } - 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; - modified_name = copy; - } - returnval = lookup_symbol_aux (modified_name, block, domain, lang, is_a_field_of_this); do_cleanups (cleanup); @@ -3069,7 +3056,9 @@ search_symbols (char *regexp, enum search_domain kind, } } - errcode = regcomp (&datum.preg, regexp, REG_NOSUB); + errcode = regcomp (&datum.preg, regexp, + REG_NOSUB | (case_sensitivity == case_sensitive_off + ? REG_ICASE : 0)); if (errcode != 0) { char *err = get_regcomp_error (errcode, &datum.preg); @@ -3519,10 +3508,13 @@ completion_list_add_name (char *symname, char *sym_text, int sym_text_len, char *text, char *word) { int newsize; + int (*ncmp) (const char *, const char *, size_t); + + ncmp = (case_sensitivity == case_sensitive_on ? strncmp : strncasecmp); /* Clip symbols that cannot match. */ - if (strncmp (symname, sym_text, sym_text_len) != 0) + if (ncmp (symname, sym_text, sym_text_len) != 0) { return; } |