diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2000-10-12 16:53:06 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2000-10-12 16:53:06 +0000 |
commit | aa68cebff02cea204a6e9a45ff19075ba22bb008 (patch) | |
tree | e99491ec039745dd92748a8f15d646a2658ea2d2 /gdb/symfile.c | |
parent | 133b1ea791aa9650899ba7964d85613d893515a5 (diff) | |
download | gdb-aa68cebff02cea204a6e9a45ff19075ba22bb008.tar.gz |
2000-10-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
From Daniel Berlin <dberlin@redhat.com> :
* symtab.c (lookup_symbol_aux): New function. Renamed from
lookup_symbol. Move code to do demangling/case sensitivity to
lookup_symbol().
(lookup_symbol): Now wrapper for lookup_symbol_aux, so we can
perform case sensitivity/demangling without leaking memory. Move
code to do demangling/case sensitivity from old_lookup_symbol to
here.
(lookup_partial_symbol): Use SYMBOL_SOURCE_NAME instead of
SYMBOL_NAME.
(lookup_block_symbol): Use SYMBOL_SOURCE_NAME instead of
SYMBOL_NAME. Don't do linear search in case of C++.
* symfile.c (compare_symbols): Use SYMBOL_SOURCE_NAME instead of
SYMBOL_NAME.
(compare_psymbols): Same here.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index 5fc516ba5bf..02f040466fb 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -212,8 +212,7 @@ compare_symbols (const PTR s1p, const PTR s2p) s1 = (struct symbol **) s1p; s2 = (struct symbol **) s2p; - - return (STRCMP (SYMBOL_NAME (*s1), SYMBOL_NAME (*s2))); + return (STRCMP (SYMBOL_SOURCE_NAME (*s1), SYMBOL_SOURCE_NAME (*s2))); } /* @@ -241,8 +240,14 @@ compare_symbols (const PTR s1p, const PTR s2p) static int compare_psymbols (const PTR s1p, const PTR s2p) { - register char *st1 = SYMBOL_NAME (*(struct partial_symbol **) s1p); - register char *st2 = SYMBOL_NAME (*(struct partial_symbol **) s2p); + register struct partial_symbol **s1, **s2; + register char *st1, *st2; + + s1 = (struct partial_symbol **) s1p; + s2 = (struct partial_symbol **) s2p; + st1 = SYMBOL_SOURCE_NAME (*s1); + st2 = SYMBOL_SOURCE_NAME (*s2); + if ((st1[0] - st2[0]) || !st1[0]) { |