diff options
author | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-12-07 09:20:31 +0100 |
---|---|---|
committer | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-12-07 09:22:06 +0100 |
commit | 5759831a2d06600a7eae4697417a388444c8e13b (patch) | |
tree | c9d0045d36dded7286e2f52b63978d63f162b828 /gdb/testsuite/gdb.linespec | |
parent | 21e051b3d666bcd614391142a936a8a8cccfa3cb (diff) | |
download | gdb-5759831a2d06600a7eae4697417a388444c8e13b.zip gdb-5759831a2d06600a7eae4697417a388444c8e13b.tar.gz gdb-5759831a2d06600a7eae4697417a388444c8e13b.tar.bz2 |
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".
Diffstat (limited to 'gdb/testsuite/gdb.linespec')
-rw-r--r-- | gdb/testsuite/gdb.linespec/keywords.exp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.linespec/keywords.exp b/gdb/testsuite/gdb.linespec/keywords.exp index 93bdcc9..645f44f 100644 --- a/gdb/testsuite/gdb.linespec/keywords.exp +++ b/gdb/testsuite/gdb.linespec/keywords.exp @@ -75,3 +75,15 @@ gdb_test "break task task 123" "Unknown task 123\\." # Test NULL location with valid conditional containing a keyword. gdb_breakpoint "thread if thread == 0" gdb_breakpoint "task if task == 0" + +# Test the positional flexibility of the "-force-condition" flag. +foreach prefix {"" "thread 1 "} { + foreach suffix {"" " " " thread 1"} { + foreach cond {"" " if 1"} { + with_test_prefix "prefix: '$prefix', suffix: '$suffix', cond: '$cond'" { + gdb_breakpoint "main ${prefix}-force-condition${suffix}${cond}"\ + "message" + } + } + } +} |