diff options
author | Paul N. Hilfinger <hilfinger@adacore.com> | 2004-05-20 09:51:34 +0000 |
---|---|---|
committer | Paul N. Hilfinger <hilfinger@adacore.com> | 2004-05-20 09:51:34 +0000 |
commit | 4725b72191dff6324b78a2fe4edb62d0abf3a204 (patch) | |
tree | 049138310c6a7358e88287e547b73f48f29bb401 /gdb/symtab.h | |
parent | 82d69f8b4ce0078cd7387634c2b5f9f6d0a42309 (diff) | |
download | gdb-4725b72191dff6324b78a2fe4edb62d0abf3a204.zip gdb-4725b72191dff6324b78a2fe4edb62d0abf3a204.tar.gz gdb-4725b72191dff6324b78a2fe4edb62d0abf3a204.tar.bz2 |
* symtab.h (SYMBOL_SEARCH_NAME): New definition.
(SYMBOL_MATCHES_SEARCH_NAME): New definition.
(symbol_search_name): Declare.
* dictionary.c (iter_name_first_hashed): Match on SYMBOL_SEARCH_NAME.
(iter_name_next_hashed): Ditto.
(iter_name_next_linear): Ditto.
(insert_symbol_hashed): Hash on SYMBOL_SEARCH_NAME.
* symtab.c (lookup_partial_symbol): Assume symbols ordered by
search name, using SYMBOL_SEARCH_NAME and SYMBOL_MATCHES_SEARCH_NAME.
(symbol_search_name): New function.
* symfile.c (compare_psymbols): Order by SYMBOL_SEARCH_NAME.
* minsyms.c (build_minimal_symbol_hash_tables): Change
test for adding to demangled hash table to check for difference
between SYMBOL_SEARCH_NAME and SYMBOL_LINKAGE_NAME.
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r-- | gdb/symtab.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h index b30fc89..6539524 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -258,6 +258,20 @@ extern char *symbol_demangled_name (struct general_symbol_info *symbol); #define SYMBOL_MATCHES_NATURAL_NAME(symbol, name) \ (strcmp_iw (SYMBOL_NATURAL_NAME (symbol), (name)) == 0) +/* Macro that returns the name to be used when sorting and searching symbols. + In C++, Chill, and Java, we search for the demangled form of a name, + and so sort symbols accordingly. In Ada, however, we search by mangled + name. If there is no distinct demangled name, then SYMBOL_SEARCH_NAME + returns the same value (same pointer) as SYMBOL_LINKAGE_NAME. */ +#define SYMBOL_SEARCH_NAME(symbol) \ + (symbol_search_name (&(symbol)->ginfo)) +extern char *symbol_search_name (const struct general_symbol_info *); + +/* Analogous to SYMBOL_MATCHES_NATURAL_NAME, but uses the search + name. */ +#define SYMBOL_MATCHES_SEARCH_NAME(symbol, name) \ + (strcmp_iw (SYMBOL_SEARCH_NAME (symbol), (name)) == 0) + /* Classification types for a minimal symbol. These should be taken as "advisory only", since if gdb can't easily figure out a classification it simply selects mst_unknown. It may also have to |