This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] [PR symtab/17602] Fix arguments to symbol_name_cmp
- From: Yao Qi <yao at codesourcery dot com>
- To: Doug Evans <dje at google dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Wed, 26 Nov 2014 17:00:25 +0800
- Subject: Re: [PATCH 2/2] [PR symtab/17602] Fix arguments to symbol_name_cmp
- Authentication-results: sourceware.org; auth=none
- References: <yjt2mw7ewq2w dot fsf at ruffy dot mtv dot corp dot google dot com>
Doug Evans <dje@google.com> writes:
> - if (data->symbol_name_cmp (name, data->lookup_name) == 0)
> + /* The order of arguments we pass to symbol_name_cmp is important as
> + strcmp_iw, a typical value for symbol_name_cmp, only performs special
> + processing of '(' to remove overload info on the first argument and not
> + the second. The first argument is what the user provided, the second
> + argument is what came from partial syms / .gdb_index. */
> + if (data->symbol_name_cmp (data->lookup_name, name) == 0)
> return 1; /* Expand this symbol's symbol table. */
> return 0; /* Skip this symbol. */
Such odd feature is documented in the comments to strcmp_iw:
As an extra hack, string1=="FOO(ARGS)" matches string2=="FOO".
This "feature" is useful when searching for matching C++ function names
(such as if the user types 'break FOO', where FOO is a mangled C++
function).
A question not related to this patch too much, do you consider to move
such c++ specific hack into c++ specific routine la_get_symbol_name_cmp?
--
Yao (éå)