This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] [PR symtab/17602] Fix arguments to symbol_name_cmp


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 (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]