diff options
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/completer.c | 6 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.linespec/explicit.exp | 14 |
4 files changed, 29 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 60b3ce4..bea7a5b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2020-12-07 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> + * completer.c (complete_explicit_location): Also add keywords + that start with '-' to the completion list. + +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 diff --git a/gdb/completer.c b/gdb/completer.c index 83b46a0..7f63ced 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -892,7 +892,11 @@ complete_explicit_location (completion_tracker &tracker, int keyword = skip_keyword (tracker, explicit_options, &text); if (keyword == -1) - complete_on_enum (tracker, explicit_options, text, text); + { + complete_on_enum (tracker, explicit_options, text, text); + /* There are keywords that start with "-". Include them, too. */ + complete_on_enum (tracker, linespec_keywords, text, text); + } else { /* Completing on value. */ diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 3c28bc7..f5219ea 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2020-12-07 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> + * gdb.linespec/explicit.exp: Extend with a test to check completing + '-' after seemingly complete options. + +2020-12-07 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> + * gdb.linespec/keywords.exp: Add tests to check positional flexibility of "-force-condition". diff --git a/gdb/testsuite/gdb.linespec/explicit.exp b/gdb/testsuite/gdb.linespec/explicit.exp index 52a1fce..c33ab50 100644 --- a/gdb/testsuite/gdb.linespec/explicit.exp +++ b/gdb/testsuite/gdb.linespec/explicit.exp @@ -469,6 +469,20 @@ namespace eval $testfile { } } + # Test that after a seemingly finished option argument, + # completion for "-" matches both the explicit location + # options and the linespec keywords that start with "-". + with_test_prefix "complete '-' after options" { + test_gdb_complete_multiple "b -function myfunction " "-" "" { + "-force-condition" + "-function" + "-label" + "-line" + "-qualified" + "-source" + } + } + # Tests that ensure that after "if" we complete on expressions # are in cpcompletion.exp. |