[gdb/testsuite, 2/2] Fix gdb.linespec/explicit.exp with check-read1
authorTom de Vries <tdevries@suse.de>
Mon, 29 Jul 2019 14:24:57 +0000 (16:24 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 29 Jul 2019 14:24:57 +0000 (16:24 +0200)
commitde28a3b72e4e85233c6ece9063696b13ef170c00
tree4b66a34e1c360184135754339b44d31513e7ee39
parent507dd60e28d0ef35ffb7c0880933d6b88cc3f5bd
[gdb/testsuite, 2/2] Fix gdb.linespec/explicit.exp with check-read1

When running gdb.linespec/explicit.exp with check-read1, we get:
...
(gdb) PASS: gdb.linespec/explicit.exp: set max-completions unlimited
break \a
-function
  ...
top
(gdb) PASS: gdb.linespec/explicit.exp: complete with no arguments
break
-function
 ...
top
(gdb) FAIL: gdb.linespec/explicit.exp: complete with no arguments (clearing input line)
...

The problem is that the send_gdb "\t\t" triggers completion twice:
...
        set tst "complete with no arguments"
        send_gdb "break \t"
        gdb_test_multiple "" $tst {
            "break \\\x07" {
                send_gdb "\t\t"
                gdb_test_multiple "" $tst {
...
}
clear_input_line $tst
...
but the following gdb_test_multiple only parses it once, so the second
completion is left for clear_input_line, which fails.

Fix this by triggering completion only once.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-07-29  Tom de Vries  <tdevries@suse.de>

* gdb.linespec/explicit.exp: Fix completion trigger for "complete with
no arguments".
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.linespec/explicit.exp