diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2000-06-05 20:49:53 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@dberlin.org> | 2000-06-05 20:49:53 +0000 |
commit | 357e46e7c9f18a0603aa9a6de440bedb147e57f8 (patch) | |
tree | 7a636a8075ad6888e5c2401e87c859f74c526183 /gdb/symtab.c | |
parent | e6d71bf34e01d840417e4fac1bcedae5fff5b9dc (diff) | |
download | gdb-357e46e7c9f18a0603aa9a6de440bedb147e57f8.zip gdb-357e46e7c9f18a0603aa9a6de440bedb147e57f8.tar.gz gdb-357e46e7c9f18a0603aa9a6de440bedb147e57f8.tar.bz2 |
C++ improvements
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 41c23aa..5f0e84a 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -954,7 +954,7 @@ lookup_symbol (name, block, namespace, is_a_field_of_this, symtab) *symtab = NULL; return 0; } - + /* Look, in partial_symtab PST, for symbol NAME. Check the global symbols if GLOBAL, the static symbols if not */ @@ -965,20 +965,20 @@ lookup_partial_symbol (pst, name, global, namespace) int global; namespace_enum namespace; { + struct partial_symbol *temp; struct partial_symbol **start, **psym; struct partial_symbol **top, **bottom, **center; int length = (global ? pst->n_global_syms : pst->n_static_syms); int do_linear_search = 1; - + if (length == 0) { return (NULL); } - start = (global ? pst->objfile->global_psymbols.list + pst->globals_offset : pst->objfile->static_psymbols.list + pst->statics_offset); - + if (global) /* This means we can use a binary search. */ { do_linear_search = 0; @@ -996,9 +996,7 @@ lookup_partial_symbol (pst, name, global, namespace) if (!(center < top)) abort (); if (!do_linear_search - && (SYMBOL_LANGUAGE (*center) == language_cplus - || SYMBOL_LANGUAGE (*center) == language_java - )) + && (SYMBOL_LANGUAGE (*center) == language_java)) { do_linear_search = 1; } @@ -1013,11 +1011,15 @@ lookup_partial_symbol (pst, name, global, namespace) } if (!(top == bottom)) abort (); - while (STREQ (SYMBOL_NAME (*top), name)) + + /* djb - 2000-06-03 - Use SYMBOL_MATCHES_NAME, not a strcmp, so + we don't have to force a linear search on C++. Probably holds true + for JAVA as well, no way to check.*/ + while (SYMBOL_MATCHES_NAME (*top,name)) { if (SYMBOL_NAMESPACE (*top) == namespace) { - return (*top); + return (*top); } top++; } @@ -1027,7 +1029,7 @@ lookup_partial_symbol (pst, name, global, namespace) we should also do a linear search. */ if (do_linear_search) - { + { for (psym = start; psym < start + length; psym++) { if (namespace == SYMBOL_NAMESPACE (*psym)) @@ -4018,6 +4020,7 @@ functions_info (regexp, from_tty) symtab_symbol_info (regexp, FUNCTIONS_NAMESPACE, from_tty); } + static void types_info (regexp, from_tty) char *regexp; @@ -4664,6 +4667,7 @@ _initialize_symtab () add_info ("functions", functions_info, "All function names, or those matching REGEXP."); + /* FIXME: This command has at least the following problems: 1. It prints builtin types (in a very strange and confusing fashion). 2. It doesn't print right, e.g. with |