aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorPaul N. Hilfinger <hilfinger@adacore.com>2004-05-20 09:51:34 +0000
committerPaul N. Hilfinger <hilfinger@adacore.com>2004-05-20 09:51:34 +0000
commit4725b72191dff6324b78a2fe4edb62d0abf3a204 (patch)
tree049138310c6a7358e88287e547b73f48f29bb401 /gdb/symtab.c
parent82d69f8b4ce0078cd7387634c2b5f9f6d0a42309 (diff)
downloadgdb-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.c')
-rw-r--r--gdb/symtab.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 7d1fd83..31a1635 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -659,6 +659,14 @@ symbol_demangled_name (struct general_symbol_info *gsymbol)
return NULL;
}
+/* Return the search name of a symbol---generally the demangled or
+ linkage name of the symbol, depending on how it will be searched for.
+ If there is no distinct demangled name, then returns the same value
+ (same pointer) as SYMBOL_LINKAGE_NAME. */
+char *symbol_search_name (const struct general_symbol_info *gsymbol) {
+ return symbol_natural_name (gsymbol);
+}
+
/* Initialize the structure fields to zero values. */
void
init_sal (struct symtab_and_line *sal)
@@ -1467,7 +1475,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name,
{
do_linear_search = 1;
}
- if (strcmp_iw_ordered (SYMBOL_NATURAL_NAME (*center), name) >= 0)
+ if (strcmp_iw_ordered (SYMBOL_SEARCH_NAME (*center), name) >= 0)
{
top = center;
}
@@ -1482,7 +1490,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name,
while (top <= real_top
&& (linkage_name != NULL
? strcmp (SYMBOL_LINKAGE_NAME (*top), linkage_name) == 0
- : SYMBOL_MATCHES_NATURAL_NAME (*top,name)))
+ : SYMBOL_MATCHES_SEARCH_NAME (*top,name)))
{
if (SYMBOL_DOMAIN (*top) == domain)
{
@@ -1503,7 +1511,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name,
{
if (linkage_name != NULL
? strcmp (SYMBOL_LINKAGE_NAME (*psym), linkage_name) == 0
- : SYMBOL_MATCHES_NATURAL_NAME (*psym, name))
+ : SYMBOL_MATCHES_SEARCH_NAME (*psym, name))
{
return (*psym);
}