diff options
author | David Carlton <carlton@bactrian.org> | 2003-03-03 18:34:12 +0000 |
---|---|---|
committer | David Carlton <carlton@bactrian.org> | 2003-03-03 18:34:12 +0000 |
commit | d0aaed087c864c0b22023f72ed28cb03a60a7ef9 (patch) | |
tree | 6317b9a80451501aa922572d0d1c1c76fccd59f4 /gdb/symtab.h | |
parent | 2266bd5f452e9cf3af4f44e621df240f8834da85 (diff) | |
download | gdb-d0aaed087c864c0b22023f72ed28cb03a60a7ef9.tar.gz |
2003-03-03 David Carlton <carlton@math.stanford.edu>
* symtab.h (DEPRECATED_SYMBOL_MATCHES_NAME): Rename from
SYMBOL_MATCHES_NAME, add comment.
(SYMBOL_MATCHES_NATURAL_NAME): New.
* minsyms.c (lookup_minimal_symbol_solib_trampoline): Replace
SYMBOL_MATCHES_NAME with DEPRECATED_SYMBOL_MATCHES_NAME.
(lookup_minimal_symbol, lookup_minimal_symbol_text): Ditto.
* symtab.c (lookup_partial_symbol): Use
SYMBOL_MATCHES_NATURAL_NAME, not SYMBOL_MATCHES_NAME. Delete
unhelpful comment.
(lookup_block_symbol): Use SYMBOL_MATCHES_NATURAL_NAME, not
SYMBOL_MATCHES_NAME.
Fix for PR c++/33.
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r-- | gdb/symtab.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h index 9e515de9321..79705fec06d 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -217,11 +217,24 @@ extern char *symbol_demangled_name (struct general_symbol_info *symbol); "foo :: bar (int, long)". Evaluates to zero if the match fails, or nonzero if it succeeds. */ -#define SYMBOL_MATCHES_NAME(symbol, name) \ +/* FIXME: carlton/2003-02-27: This is an unholy mixture of linkage + names and natural names. If you want to test the linkage names + with strcmp, do that. If you want to test the natural names with + strcmp_iw, use SYMBOL_MATCHES_NATURAL_NAME. */ + +#define DEPRECATED_SYMBOL_MATCHES_NAME(symbol, name) \ (STREQ (DEPRECATED_SYMBOL_NAME (symbol), (name)) \ || (SYMBOL_DEMANGLED_NAME (symbol) != NULL \ && strcmp_iw (SYMBOL_DEMANGLED_NAME (symbol), (name)) == 0)) +/* Macro that tests a symbol for a match against a specified name + string. It tests against SYMBOL_NATURAL_NAME, and it ignores + whitespace and trailing parentheses. (See strcmp_iw for details + about its behavior.) */ + +#define SYMBOL_MATCHES_NATURAL_NAME(symbol, name) \ + (strcmp_iw (SYMBOL_NATURAL_NAME (symbol), (name)) == 0) + /* Define a simple structure used to hold some very basic information about all defined global symbols (text, data, bss, abs, etc). The only required information is the general_symbol_info. |