Linespec lexing and C++ operators
authorPedro Alves <palves@redhat.com>
Mon, 17 Jul 2017 19:28:12 +0000 (20:28 +0100)
committerPedro Alves <palves@redhat.com>
Mon, 17 Jul 2017 19:28:12 +0000 (20:28 +0100)
commitbe966d4207ff8df6572a23b911e5a69a2ab9370f
tree339fc204a3a7af66f9e4f6160605f25cafe4fd26
parenta245927022bc4351fafd9e6275e217021ec93e08
Linespec lexing and C++ operators

There's some lexing code in linespec that isn't handling C++ operators
correctly.  It's the usual confusion with operator< / operator<<, in
code that wants to skip past template parameters.

The linespec_lexer_lex_string change is necessary otherwise we get
this (with current master):

 (gdb) break 'operator<'
 unmatched quote

The need for the find_toplevel_char change was exposed by the use of
that function in the explicit location completer.  Without the fix,
that completer is not able to "see" past operator< symbols, without
quoting, like:

 (gdb) b -function operator<(int, int) -labe[TAB]    # nothing happens

gdb incorrectly thinks "-labe" is part of the "unclosed" template
parameter list started with "<".

gdb/ChangeLog:
2017-07-17  Pedro Alves  <palves@redhat.com>

* linespec.c (linespec_lexer_lex_string, find_toplevel_char):
Handle 'operator<' / 'operator<<'.
gdb/ChangeLog
gdb/linespec.c
This page took 0.025406 seconds and 4 git commands to generate.