aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-06-21 16:16:50 +0200
committerTom de Vries <tdevries@suse.de>2023-06-21 16:16:50 +0200
commitb96cac16078d282ee0924296817c6eee52196669 (patch)
tree200b0853f6ab865b050fca9c8f29713ab2e79ce5 /gdb
parentdc808a2ebab337b5517add4c1aad298cf836c239 (diff)
downloadbinutils-b96cac16078d282ee0924296817c6eee52196669.zip
binutils-b96cac16078d282ee0924296817c6eee52196669.tar.gz
binutils-b96cac16078d282ee0924296817c6eee52196669.tar.bz2
[gdb/testsuite] Fix gdb.tui/wrap-line.exp
PR testsuite/30458 reports the following FAIL: ... PASS: gdb.tui/wrap-line.exp: width-auto-detected: cli: wrap ^CQuit (gdb) WARNING: timeout in accept_gdb_output Screen Dump (size 50 columns x 24 rows, cursor at column 6, row 3): 0 Quit 1 (gdb) 7890123456789012345678901234567890123456789 2 W^CQuit 3 (gdb) ... FAIL: gdb.tui/wrap-line.exp: width-auto-detected: cli: prompt after wrap ... The problem is that the regexp doesn't account for the ^C: ... gdb_assert { [Term::wait_for "^WQuit"] } "prompt after wrap" ... The ^C occurs occasionally. This is something we'd like to fix. It's reported as a readline problem here ( https://lists.gnu.org/archive/html/bug-readline/2023-06/msg00000.html ). For now, fix this by updating the regexp, and likewise in another place in the test-case where we use ^C. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30458
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/gdb.tui/wrap-line.exp10
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.tui/wrap-line.exp b/gdb/testsuite/gdb.tui/wrap-line.exp
index 2f0e4a5..1aac6fa 100644
--- a/gdb/testsuite/gdb.tui/wrap-line.exp
+++ b/gdb/testsuite/gdb.tui/wrap-line.exp
@@ -25,6 +25,12 @@ set cols 50
set lines 24
set dims [list $lines $cols]
+# Sometimes we see ^C. This is something we'd like to fix. It's reported as
+# a readline problem here (
+# https://lists.gnu.org/archive/html/bug-readline/2023-06/msg00000.html ).
+# For now, ignore it.
+set re_control_c "(\\^C)?Quit"
+
# Fill line, assuming we start after the gdb prompt.
proc fill_line { width } {
set res ""
@@ -47,7 +53,7 @@ proc fill_line { width } {
proc test_wrap { wrap_width } {
# Generate a prompt and parse it.
send_gdb "\003"
- gdb_assert { [Term::wait_for "(^|$::gdb_prompt )Quit"] } "start line"
+ gdb_assert { [Term::wait_for "(^|$::gdb_prompt )$::re_control_c"] } "start line"
# Fill the line to just before wrapping.
set str [fill_line $wrap_width]
@@ -64,7 +70,7 @@ proc test_wrap { wrap_width } {
# Generate a prompt and parse it.
send_gdb "\003"
- gdb_assert { [Term::wait_for "^WQuit"] } "prompt after wrap"
+ gdb_assert { [Term::wait_for "^W$::re_control_c"] } "prompt after wrap"
}
# Test wrapping in both CLI and TUI.