gdb/linespec: relax the position of the '-force-condition' flag
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Mon, 7 Dec 2020 08:20:31 +0000 (09:20 +0100)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Mon, 7 Dec 2020 08:22:06 +0000 (09:22 +0100)
commit5759831a2d06600a7eae4697417a388444c8e13b
treec9d0045d36dded7286e2f52b63978d63f162b828
parent21e051b3d666bcd614391142a936a8a8cccfa3cb
gdb/linespec: relax the position of the '-force-condition' flag

The break command's "-force-condition" flag is currently required to
be followed by the "if" keyword.  This prevents flexibility when using
other keywords, e.g. "thread":

  (gdb) break main -force-condition thread 1 if foo
  Function "main -force-condition" not defined.
  Make breakpoint pending on future shared library load? (y or [n]) n

Remove the requirement that "-force-condition" is always followed by
an "if", so that more flexibility is obtained when positioning
keywords.

gdb/ChangeLog:
2020-12-07  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

* linespec.c (linespec_lexer_lex_keyword): The "-force-condition"
keyword may be followed by any keyword.
* breakpoint.c (find_condition_and_thread): Advance 'tok' by
'toklen' in the case for "-force-condition".

gdb/testsuite/ChangeLog:
2020-12-07  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

* gdb.linespec/keywords.exp: Add tests to check positional
flexibility of "-force-condition".
gdb/ChangeLog
gdb/breakpoint.c
gdb/linespec.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.linespec/keywords.exp