binutils-gdb/gdb/testsuite/gdb.linespec
Keith Seitz 64a9760601 Support template lookups in strncmp_iw_with_mode
This patch adds support for wild template parameter list matches, similar
to how ABI tags or function overloads are now handled.

With this patch, users will be able to "gloss over" the details of matching
template parameter lists.  This is accomplished by adding (yet more) logic
to strncmp_iw_with_mode to skip parameter lists if none is explicitly given
by the user.

Here's a simple example using gdb.linespec/cpls-ops.exp:

Before
------
(gdb) ptype test_op_call
type = struct test_op_call {
  public:
    void operator()(void);
    void operator()(int);
    void operator()(long);
    void operator()<int>(int *);
}
(gdb) b test_op_call::operator()
Breakpoint 1 at 0x400583: test_op_call::operator(). (3 locations)
(gdb) i b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   <MULTIPLE>
1.1                         y     0x400583 in test_op_call::operator()(int)
                                                   at cpls-ops.cc:43
1.2                         y     0x40058e in test_op_call::operator()()
                                                   at cpls-ops.cc:47
1.3                         y     0x40059e in test_op_call::operator()(long)
                                                   at cpls-ops.cc:51

The breakpoint at test_op_call::operator()<int> was never set.

After
-----
(gdb) b test_op_call::operator()
Breakpoint 1 at 0x400583: test_op_call::operator(). (4 locations)
(gdb) i b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   <MULTIPLE>
1.1                         y     0x400583 in test_op_call::operator()(int)
                                                   at cpls-ops.cc:43
1.2                         y     0x40058e in test_op_call::operator()()
                                                   at cpls-ops.cc:47
1.3                         y     0x40059e in test_op_call::operator()(long)
                                                   at cpls-ops.cc:51
1.4                         y     0x4008d0 in test_op_call::operator()<int>(int*)
                                                   at cpls-ops.cc:57

Similar to how scope lookups work, passing "-qualified" to the break command
will cause a literal lookup of the symbol.  In the example immediately above,
this will cause GDB to only find the three non-template functions.
2022-02-24 16:42:22 -08:00
..
base
3explicit.c
body.h
break-ask.exp
break-asm-file.c
break-asm-file.exp
break-asm-file0.s
break-asm-file1.s
cp-completion-aliases.cc
cp-completion-aliases.exp
cp-replace-typedefs-ns-template.cc
cp-replace-typedefs-ns-template.exp
cpcompletion.exp Support template lookups in strncmp_iw_with_mode 2022-02-24 16:42:22 -08:00
cpexplicit.cc
cpexplicit.exp
cpls-abi-tag.cc
cpls-abi-tag.exp
cpls-hyphen.cc
cpls-ops.cc
cpls-ops.exp Support template lookups in strncmp_iw_with_mode 2022-02-24 16:42:22 -08:00
cpls.cc Support template lookups in strncmp_iw_with_mode 2022-02-24 16:42:22 -08:00
cpls2.cc
errors.exp gdb: handle calls to edit command passing only a linespec condition 2022-02-02 16:27:36 +00:00
explicit.c
explicit.exp
explicit2.c
keywords.c
keywords.exp
linespec.exp
ls-dollar.cc
ls-dollar.exp
ls-errs.c
ls-errs.exp
lspec.cc
lspec.h
macro-relative.c
macro-relative.exp
skip-two.exp
thread.c
thread.exp