diff options
-rw-r--r-- | gdb/ChangeLog | 48 | ||||
-rw-r--r-- | gdb/ax-gdb.c | 2 | ||||
-rw-r--r-- | gdb/c-exp.y | 5 | ||||
-rw-r--r-- | gdb/f-exp.y | 2 | ||||
-rw-r--r-- | gdb/findvar.c | 2 | ||||
-rw-r--r-- | gdb/hppa-tdep.c | 8 | ||||
-rw-r--r-- | gdb/jv-exp.y | 2 | ||||
-rw-r--r-- | gdb/m2-exp.y | 2 | ||||
-rw-r--r-- | gdb/minsyms.c | 87 | ||||
-rw-r--r-- | gdb/objc-exp.y | 5 | ||||
-rw-r--r-- | gdb/objc-lang.c | 6 | ||||
-rw-r--r-- | gdb/p-exp.y | 5 | ||||
-rw-r--r-- | gdb/printcmd.c | 4 | ||||
-rw-r--r-- | gdb/remote.c | 5 | ||||
-rw-r--r-- | gdb/sol-thread.c | 2 | ||||
-rw-r--r-- | gdb/stabsread.c | 10 | ||||
-rw-r--r-- | gdb/symtab.c | 6 | ||||
-rw-r--r-- | gdb/symtab.h | 17 | ||||
-rw-r--r-- | gdb/tracepoint.c | 2 | ||||
-rw-r--r-- | gdb/valops.c | 5 |
20 files changed, 145 insertions, 80 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2d29a275e30..86bd57cb8df 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,51 @@ +2003-03-07 David Carlton <carlton@math.stanford.edu> + + * symtab.c (lookup_partial_symbol): Replace uses of + SYMBOL_MATCHES_NATURAL_NAME by equivalent uses of + SYMBOL_NATURAL_NAME, strcmp_iw. + * symtab.h (SYMBOL_MATCHES_NATURAL_NAME): Delete. + * minsyms.c (lookup_minimal_symbol_linkage): Make static. + (lookup_minimal_symbol_natural): Ditto. + (lookup_minimal_symbol): Only search on linkage names; rename + first argument to 'linkage_name'. + (lookup_minimal_symbol_linkage): Delete. + (lookup_minimal_symbol_natural): Delete. + (add_minsym_to_demangled_hash_table): Go back to using + SYMBOL_DEMANGLED_NAME instead of SYMBOL_NATURAL_NAME. + (lookup_minimal_symbol_aux): Don't use + SYMBOL_MATCHES_NATURAL_NAME: do a strcmp_iw on + SYMBOL_DEMANGLED_NAME instead. Add comment. + (build_minimal_symbol_hash_tables): Go back to only adding to + demangled has table if SYMBOL_DEMANGLED_NAME is non-NULL. + * symtab.h: Delete declarations for lookup_minimal_symbol_linkage + and lookup_minimal_symbol_natural. + * valops.c (find_function_in_inferior): Use lookup_symbol_linkage + instead of lookup_symbol. Change comment. + * remote.c (remote_check_symbols): Use + lookup_minimal_symbol_linkage_or_natural instead of + lookup_minimal_symbol, but add FIXME comment as well. + * objc-lang.c: Ditto. + * c-exp.y: Use lookup_minimal_symbol_linkage_or_natural instead of + lookup_minimal_symbol. + * p-exp.y: Ditto. + * objc-exp.y: Ditto. + * m2-exp.y: Ditto. + * jv-exp.y (push_expression_name): Ditto. + * f-exp.y: Ditto. + * printcmd.c (address_info): Ditto. + * symtab.h: Declare lookup_minimal_symbol_linkage_or_natural. + * minsyms.c (lookup_minimal_symbol_linkage_or_natural): New. + * ax-gdb.c (gen_var_ref): Use SYMBOL_LINKAGE_NAME instead of + DEPRECATED_SYMBOL_NAME. + * tracepoint.c (scope_info): Ditto. + * symtab.c (find_pc_sect_line): Ditto. + * stabsread.c (define_symbol): Ditto. + * sol-thread.c (info_cb): Ditto. + * printcmd.c (address_info): Ditto. + * hppa-tdep.c (hppa_fix_call_dummy): Ditto. + (hppa_in_solib_call_trampoline): Ditto. + * findvar.c (read_var_value): Ditto. + 2003-03-06 David Carlton <carlton@math.stanford.edu> * minsyms.c (add_minsym_to_hash_table): Use SYMBOL_LINKAGE_NAME. diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 5692c35f990..cb8ff2c4210 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -609,7 +609,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var) case LOC_UNRESOLVED: { struct minimal_symbol *msym - = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (var), NULL, NULL); + = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL); if (!msym) error ("Couldn't resolve symbol `%s'.", SYMBOL_PRINT_NAME (var)); diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 1eb82396994..dae4aca8075 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -655,7 +655,8 @@ variable: qualified_name break; } - msymbol = lookup_minimal_symbol (name, NULL, NULL); + msymbol + = lookup_minimal_symbol_linkage_or_natural (name); if (msymbol != NULL) { write_exp_msymbol (msymbol, @@ -711,7 +712,7 @@ variable: name_not_typename register char *arg = copy_name ($1.stoken); msymbol = - lookup_minimal_symbol (arg, NULL, NULL); + lookup_minimal_symbol_linkage_or_natural (arg); if (msymbol != NULL) { write_exp_msymbol (msymbol, diff --git a/gdb/f-exp.y b/gdb/f-exp.y index a9504c18418..e25a5d2ed68 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -479,7 +479,7 @@ variable: name_not_typename register char *arg = copy_name ($1.stoken); msymbol = - lookup_minimal_symbol (arg, NULL, NULL); + lookup_minimal_symbol_linkage_or_natural (arg); if (msymbol != NULL) { write_exp_msymbol (msymbol, diff --git a/gdb/findvar.c b/gdb/findvar.c index 56f5b82f7d4..2283d4daa9a 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -629,7 +629,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i { struct minimal_symbol *msym; - msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (var), NULL, NULL); + msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL); if (msym == NULL) return 0; if (overlay_debugging) diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 99ef1450fa9..a03f8506223 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -2234,10 +2234,10 @@ hppa_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, { stub_symbol = lookup_minimal_symbol_solib_trampoline - (DEPRECATED_SYMBOL_NAME (funsymbol), NULL, objfile); + (SYMBOL_LINKAGE_NAME (funsymbol), NULL, objfile); if (!stub_symbol) - stub_symbol = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (funsymbol), + stub_symbol = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (funsymbol), NULL, objfile); /* Found a symbol with the right name. */ @@ -3014,7 +3014,7 @@ hppa_in_solib_call_trampoline (CORE_ADDR pc, char *name) return 1; minsym = lookup_minimal_symbol_by_pc (pc); - if (minsym && strcmp (DEPRECATED_SYMBOL_NAME (minsym), ".stub") == 0) + if (minsym && strcmp (SYMBOL_LINKAGE_NAME (minsym), ".stub") == 0) return 1; /* Get the unwind descriptor corresponding to PC, return zero @@ -3352,7 +3352,7 @@ hppa_skip_trampoline_code (CORE_ADDR pc) return orig_pc == pc ? 0 : pc & ~0x3; } - libsym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (stubsym), NULL, NULL); + libsym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (stubsym), NULL, NULL); if (libsym == NULL) { warning ("Unable to find library symbol for %s\n", diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index 7780c37b2d1..ff64e7d539d 100644 --- a/gdb/jv-exp.y +++ b/gdb/jv-exp.y @@ -1405,7 +1405,7 @@ push_expression_name (name) { struct minimal_symbol *msymbol; - msymbol = lookup_minimal_symbol (tmp, NULL, NULL); + msymbol = lookup_minimal_symbol_linkage_or_natural (tmp); if (msymbol != NULL) { write_exp_msymbol (msymbol, diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index ef0197aaebf..4ad3304e015 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -621,7 +621,7 @@ variable: NAME register char *arg = copy_name ($1); msymbol = - lookup_minimal_symbol (arg, NULL, NULL); + lookup_minimal_symbol_linkage_or_natural (arg); if (msymbol != NULL) { write_exp_msymbol diff --git a/gdb/minsyms.c b/gdb/minsyms.c index cf35c0e2133..6f6deeb258a 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -76,6 +76,16 @@ static int msym_bunch_index; static int msym_count; +static struct minimal_symbol *lookup_minimal_symbol_linkage (const char *name, + const char *sfile, + struct objfile + *objf); + +static struct minimal_symbol *lookup_minimal_symbol_natural (const char *name, + const char *sfile, + struct objfile + *objf); + static struct minimal_symbol *lookup_minimal_symbol_aux (const char *name, int linkage, const char *sfile, @@ -134,7 +144,7 @@ add_minsym_to_demangled_hash_table (struct minimal_symbol *sym, if (sym->demangled_hash_next == NULL) { unsigned int hash - = (msymbol_hash_iw (SYMBOL_NATURAL_NAME (sym)) + = (msymbol_hash_iw (SYMBOL_DEMANGLED_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE); sym->demangled_hash_next = table[hash]; table[hash] = sym; @@ -143,58 +153,66 @@ add_minsym_to_demangled_hash_table (struct minimal_symbol *sym, /* Look through all the current minimal symbol tables and find the - first minimal symbol that matches NAME. If OBJF is non-NULL, limit - the search to that objfile. If SFILE is non-NULL, the only file-scope - symbols considered will be from that source file (global symbols are - still preferred). Returns a pointer to the minimal symbol that - matches, or NULL if no match is found. + first minimal symbol whose linkage name is LINKAGE_NAME. If OBJF + is non-NULL, limit the search to that objfile. If SFILE is + non-NULL, the only file-scope symbols considered will be from that + source file (global symbols are still preferred). Returns a + pointer to the minimal symbol that matches, or NULL if no match is + found. Note: One instance where there may be duplicate minimal symbols with the same name is when the symbol tables for a shared library and the symbol tables for an executable contain global symbols with the same - names (the dynamic linker deals with the duplication). + names (the dynamic linker deals with the duplication). */ - This function first searches for matches via linkage names; if it - doesn't find a match there, it then searches via natural names. */ +/* NOTE: carlton/2003-03-07: This function used to match on natural + names as well; if you want that behavior, call + lookup_minimal_symbol_linkage_or_natural. */ struct minimal_symbol * -lookup_minimal_symbol (register const char *name, const char *sfile, +lookup_minimal_symbol (register const char *linkage_name, const char *sfile, struct objfile *objf) { - struct minimal_symbol *msymbol; + return lookup_minimal_symbol_aux (linkage_name, 1, sfile, objf); +} - msymbol = lookup_minimal_symbol_linkage (name, sfile, objf); +/* Search for a minimal symbol named NAME. Search for that name as + either a linkage name or a natural name. */ - if (msymbol != NULL) - return msymbol; - else - return lookup_minimal_symbol_natural (name, sfile, objf); -} +/* NOTE: carlton/2003-03-07: I normally strongly dislike functions + that accept either linkage names or natural names, but I'm making + an exception here: callers of this function derive NAME from user + input, and do so in situations where using a linkage name might be + necessary as a workaround for some of GDB's C++ bugs. */ -/* Search for a minimal symbol via linkage names; args are as in - lookup_minimal_symbol. */ +/* NOTE: carlton/2003-03-07: This never searches on all natural names + at once: it searches on linkage names via strcmp, and on demangled + names via strcmp_iw. However, for natural names that turn out to + be linkage names of minimal symbols, using strcmp in place of + strcmp_iw is safe. (You have to be more careful if the name isn't + associated to a minimal symbol: see PR gdb/33.) */ struct minimal_symbol * -lookup_minimal_symbol_linkage (const char *name, const char *sfile, - struct objfile *objf) +lookup_minimal_symbol_linkage_or_natural (const char *name) { - return lookup_minimal_symbol_aux (name, 1, sfile, objf); -} + struct minimal_symbol *msymbol; -/* Search for a minimal symbol via natural names; args are as in - lookup_minimal_symbol. */ + msymbol = lookup_minimal_symbol_aux (name, 1, NULL, NULL); -struct minimal_symbol * -lookup_minimal_symbol_natural (const char *name, const char *sfile, - struct objfile *objf) -{ - return lookup_minimal_symbol_aux (name, 0, sfile, objf); + if (msymbol != NULL) + return msymbol; + else + return lookup_minimal_symbol_aux (name, 0, NULL, NULL); } /* Helper function for lookup_minimal_symbol and friends, which only searches for matches via linkage names or natural names but not both. Args are in lookup_minimal_symbol; if LINKAGE is non-zero, - search in linkage names, if zero, search in natural names. */ + search in linkage names via strcmp, and if zero, search in + demangled names via strcmp_iw. */ + +/* NOTE: carlton/2003-03-07: If non-zero, it really only searches in + demangled names, not in all natural names. Be careful. */ static struct minimal_symbol * lookup_minimal_symbol_aux (const char *name, int linkage, @@ -237,7 +255,7 @@ lookup_minimal_symbol_aux (const char *name, int linkage, { if (linkage ? strcmp (SYMBOL_LINKAGE_NAME (msymbol), name) == 0 - : SYMBOL_MATCHES_NATURAL_NAME (msymbol, name)) + : strcmp_iw (SYMBOL_DEMANGLED_NAME (msymbol), name) == 0) { switch (MSYMBOL_TYPE (msymbol)) { @@ -845,8 +863,9 @@ build_minimal_symbol_hash_tables (struct objfile *objfile) add_minsym_to_hash_table (msym, objfile->msymbol_hash); msym->demangled_hash_next = 0; - add_minsym_to_demangled_hash_table (msym, - objfile->msymbol_demangled_hash); + if (SYMBOL_DEMANGLED_NAME (msym) != NULL) + add_minsym_to_demangled_hash_table (msym, + objfile->msymbol_demangled_hash); } } diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y index dc8866cd26e..e6155bac829 100644 --- a/gdb/objc-exp.y +++ b/gdb/objc-exp.y @@ -716,7 +716,8 @@ variable: qualified_name break; } - msymbol = lookup_minimal_symbol (name, NULL, NULL); + msymbol + = lookup_minimal_symbol_linkage_or_natural (name); if (msymbol != NULL) { write_exp_msymbol (msymbol, @@ -772,7 +773,7 @@ variable: name_not_typename register char *arg = copy_name ($1.stoken); msymbol = - lookup_minimal_symbol (arg, NULL, NULL); + lookup_minimal_symbol_linkage_or_natural (arg); if (msymbol != NULL) { write_exp_msymbol (msymbol, diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index cee41eb72fc..22926853db2 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -1446,7 +1446,11 @@ char *find_imps (struct symtab *symtab, struct block *block, } if (sym == NULL) - msym = lookup_minimal_symbol (selector, 0, 0); + { + /* FIXME: carlton/2003-03-07: I don't know what SELECTOR looks + like: is it a linkage name or a natural name? I'll accept + natural names for now, to be on the safe side. */ + msym = lookup_minimal_symbol_linkage_or_natural (selector); if (msym != NULL) { diff --git a/gdb/p-exp.y b/gdb/p-exp.y index bdfcf05ff2f..4863947bcaf 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -620,7 +620,8 @@ variable: qualified_name break; } - msymbol = lookup_minimal_symbol (name, NULL, NULL); + msymbol + = lookup_minimal_symbol_linkage_or_natural (name); if (msymbol != NULL) { write_exp_msymbol (msymbol, @@ -690,7 +691,7 @@ variable: name_not_typename register char *arg = copy_name ($1.stoken); msymbol = - lookup_minimal_symbol (arg, NULL, NULL); + lookup_minimal_symbol_linkage_or_natural (arg); if (msymbol != NULL) { write_exp_msymbol (msymbol, diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 96736f74f6f..167abba5d4f 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1096,7 +1096,7 @@ address_info (char *exp, int from_tty) return; } - msymbol = lookup_minimal_symbol (exp, NULL, NULL); + msymbol = lookup_minimal_symbol_linkage_or_natural (exp); if (msymbol != NULL) { @@ -1242,7 +1242,7 @@ address_info (char *exp, int from_tty) { struct minimal_symbol *msym; - msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, NULL); + msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), NULL, NULL); if (msym == NULL) printf_filtered ("unresolved"); else diff --git a/gdb/remote.c b/gdb/remote.c index 5edea010275..45f1aff8991 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -2227,7 +2227,10 @@ remote_check_symbols (struct objfile *objfile) tmp = &reply[8]; end = hex2bin (tmp, msg, strlen (tmp) / 2); msg[end] = '\0'; - sym = lookup_minimal_symbol (msg, NULL, NULL); + /* FIXME: carlton/2003-03-07: I have no idea if natural names + are allowed here; allowing them is safest. Somebody else + should look at this. */ + sym = lookup_minimal_symbol_linkage_or_natural (msg); if (sym == NULL) sprintf (msg, "qSymbol::%s", &reply[8]); else diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 1d379e9ec19..e1157aec203 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -1476,7 +1476,7 @@ info_cb (const td_thrhandle_t *th, void *s) struct minimal_symbol *msym; msym = lookup_minimal_symbol_by_pc (ti.ti_startfunc); if (msym) - printf_filtered (" startfunc: %s\n", DEPRECATED_SYMBOL_NAME (msym)); + printf_filtered (" startfunc: %s\n", SYMBOL_LINKAGE_NAME (msym)); else printf_filtered (" startfunc: 0x%s\n", paddr (ti.ti_startfunc)); } diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 88ab300754f..dffd593e1a8 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -1801,13 +1801,13 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_CLASS (sym) = LOC_STATIC; SYMBOL_VALUE_ADDRESS (sym) = valu; #ifdef STATIC_TRANSFORM_NAME - if (IS_STATIC_TRANSFORM_NAME (DEPRECATED_SYMBOL_NAME (sym))) + if (IS_STATIC_TRANSFORM_NAME (SYMBOL_LINKAGE_NAME (sym))) { struct minimal_symbol *msym; - msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, objfile); + msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), NULL, objfile); if (msym != NULL) { - DEPRECATED_SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (DEPRECATED_SYMBOL_NAME (sym)); + SYMBOL_LINKAGE_NAME (sym) = STATIC_TRANSFORM_NAME (SYMBOL_LINKAGE_NAME (sym)); SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym); } } @@ -1959,10 +1959,10 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, if (IS_STATIC_TRANSFORM_NAME (DEPRECATED_SYMBOL_NAME (sym))) { struct minimal_symbol *msym; - msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, objfile); + msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), NULL, objfile); if (msym != NULL) { - DEPRECATED_SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (DEPRECATED_SYMBOL_NAME (sym)); + SYMBOL_LINKAGE_NAME (sym) = STATIC_TRANSFORM_NAME (SYMBOL_LINKAGE_NAME (sym)); SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym); } } diff --git a/gdb/symtab.c b/gdb/symtab.c index c71c6eea8ba..b134f02a19b 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1538,7 +1538,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))) + : strcmp_iw (SYMBOL_NATURAL_NAME (*top), name) == 0)) { if (SYMBOL_NAMESPACE (*top) == namespace) { @@ -1559,7 +1559,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)) + : strcmp_iw (SYMBOL_NATURAL_NAME (*psym), name) == 0) { return (*psym); } @@ -2065,7 +2065,7 @@ find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent) if (msymbol != NULL) if (MSYMBOL_TYPE (msymbol) == mst_solib_trampoline) { - mfunsym = lookup_minimal_symbol_text (DEPRECATED_SYMBOL_NAME (msymbol), NULL, NULL); + mfunsym = lookup_minimal_symbol_text (SYMBOL_LINKAGE_NAME (msymbol), NULL, NULL); if (mfunsym == NULL) /* I eliminated this warning since it is coming out * in the following situation: diff --git a/gdb/symtab.h b/gdb/symtab.h index 9c784a7eefd..e0ce92f1626 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -211,14 +211,6 @@ extern const char *symbol_demangled_name (const struct general_symbol_info #define SYMBOL_PRINT_NAME(symbol) \ (demangle ? SYMBOL_NATURAL_NAME (symbol) : SYMBOL_LINKAGE_NAME (symbol)) -/* 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. @@ -1124,13 +1116,8 @@ extern struct minimal_symbol *lookup_minimal_symbol (const char *, const char *, struct objfile *); -extern struct minimal_symbol *lookup_minimal_symbol_linkage (const char *, - const char *, - struct objfile *); - -extern struct minimal_symbol *lookup_minimal_symbol_natural (const char *, - const char *, - struct objfile *); +extern struct +minimal_symbol *lookup_minimal_symbol_linkage_or_natural (const char *); extern struct minimal_symbol *lookup_minimal_symbol_text (const char *, const char *, diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 70c1b8bb734..20472c0fc67 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -2435,7 +2435,7 @@ scope_info (char *args, int from_tty) REGISTER_NAME (SYMBOL_BASEREG (sym))); break; case LOC_UNRESOLVED: - msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, NULL); + msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), NULL, NULL); if (msym == NULL) printf_filtered ("Unresolved Static"); else diff --git a/gdb/valops.c b/gdb/valops.c index 36408ef53be..647a7fcb189 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -161,13 +161,14 @@ int unwind_on_signal_p = 0; static int coerce_float_to_double; -/* Find the address of function name NAME in the inferior. */ +/* Find the address of function whose linkage name is NAME in the + inferior. */ struct value * find_function_in_inferior (const char *name) { register struct symbol *sym; - sym = lookup_symbol (name, 0, VAR_NAMESPACE, 0, NULL); + sym = lookup_symbol_linkage (name); if (sym != NULL) { if (SYMBOL_CLASS (sym) != LOC_BLOCK) |