diff options
author | Tom de Vries <tdevries@suse.de> | 2022-05-08 19:47:40 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2022-05-08 19:47:40 +0200 |
commit | 4a43e2435b1a24d5bd32fae7807fdba8e93b93fe (patch) | |
tree | 8e64be4e67740855ac04862e0cd1a394a21d2889 /gdb/testsuite/gdb.tui/scroll.exp | |
parent | a1aaf801d5f0989ea0857dfd896830570603b523 (diff) | |
download | gdb-4a43e2435b1a24d5bd32fae7807fdba8e93b93fe.zip gdb-4a43e2435b1a24d5bd32fae7807fdba8e93b93fe.tar.gz gdb-4a43e2435b1a24d5bd32fae7807fdba8e93b93fe.tar.bz2 |
[gdb/testsuite] Fix gdb.tui/scroll.exp with read1
When running test-case gdb.tui/scroll.exp, I get:
...
Box Dump (80 x 8) @ (0, 0):
0 $17 = 16
1 (gdb) p 17
2 $18 = 17
3 (gdb) p 18
4 $19 = 18
5 (gdb) p 19
6 $20 = 19
7 (gdb)
PASS: gdb.tui/scroll.exp: check cmd window in flip layout
...
but with check-read1 I get instead:
...
Box Dump (80 x 8) @ (0, 0):
0 (gdb) 15
1 (gdb) p 16
2 $17 = 16
3 (gdb) p 17
4 $18 = 17
5 (gdb) p 18
6 $19 = 18
7 (gdb) p 19
FAIL: gdb.tui/scroll.exp: check cmd window in flip layout
...
The "p 19" command is handled by Term::command, which sends the command and then
does Term::wait_for "^$gdb_prompt [string_to_regexp $cmd]", which:
- matches the line with "(gdb) p 19", and
- tries to match the following prompt "(gdb) "
The problem is that scrolling results in reissuing output before the "(gdb) p
19", and the second matching triggers on that. Consequently, wait_for no
longer translates gdb output into screen actions, and the screen does not
reflect the result of "p 19".
Fix this by using a new proc wait_for_region_contents, which in contrast to
wait_for can handle a multi-line regexp.
Tested on x86_64-linux with make targets check and check-read1.
Diffstat (limited to 'gdb/testsuite/gdb.tui/scroll.exp')
-rw-r--r-- | gdb/testsuite/gdb.tui/scroll.exp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.tui/scroll.exp b/gdb/testsuite/gdb.tui/scroll.exp index c23cd2b..f34f8fd 100644 --- a/gdb/testsuite/gdb.tui/scroll.exp +++ b/gdb/testsuite/gdb.tui/scroll.exp @@ -60,7 +60,13 @@ Term::command "winheight cmd 8" Term::check_box "src window after resize" 0 8 80 16 for {set i 10} {$i < 20} {incr i 1} { - Term::command "p $i" + set cmd "p $i" + send_gdb "$cmd\n" + Term::wait_for_region_contents 0 0 80 8 \ + [multi_line \ + "$gdb_prompt [string_to_regexp $cmd]\\s+" \ + "\\\$\\d+ = $i\\s+" \ + "$gdb_prompt "] } # Now check that the contents of the command window are as expected. |