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: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches at sourceware dot org, Joel Brobecker <brobecker at adacore dot com>
- Date: Thu, 04 Dec 2014 12:48:17 +0100
- 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>
On Wed, Nov 26 2014, Doug Evans wrote:
> diff --git a/gdb/linespec.c b/gdb/linespec.c
> index 5325702..35b0205 100644
> --- a/gdb/linespec.c
> +++ b/gdb/linespec.c
> @@ -982,7 +982,12 @@ iterate_name_matcher (const char *name, void *d)
> {
> const struct symbol_matcher_data *data = d;
>
> - 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. */
> }
This seems to cause a regression for the Ada testcase "operator_bp.exp":
> [...]
> FAIL: gdb.ada/operator_bp.exp: break "+" (got interactive prompt)
> FAIL: gdb.ada/operator_bp.exp: break "-" (got interactive prompt)
> FAIL: gdb.ada/operator_bp.exp: break "*" (got interactive prompt)
> FAIL: gdb.ada/operator_bp.exp: break "/" (got interactive prompt)
> FAIL: gdb.ada/operator_bp.exp: break "mod" (got interactive prompt)
> FAIL: gdb.ada/operator_bp.exp: break "rem" (got interactive prompt)
> FAIL: gdb.ada/operator_bp.exp: break "**" (got interactive prompt)
> [...]
See https://sourceware.org/ml/gdb-testers/2014-q4/msg00126.html
The problem occurs like this:
(gdb) break "+"
Function ""+"" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) FAIL: gdb.ada/operator_bp.exp: break "+" (got interactive prompt)
When reverting the patch, the test succeeds again.