aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-05-31 15:06:40 +0200
committerTom de Vries <tdevries@suse.de>2023-05-31 15:06:40 +0200
commit6e9bcaad3fd8f7635afb9fa7013762da2eeff8e5 (patch)
treee5e5ece87b509847b93f74ddc30ab9be3cf21639 /gdb
parent768d1d879be2d134e049521f28d4d5e03b69bafc (diff)
downloadgdb-6e9bcaad3fd8f7635afb9fa7013762da2eeff8e5.zip
gdb-6e9bcaad3fd8f7635afb9fa7013762da2eeff8e5.tar.gz
gdb-6e9bcaad3fd8f7635afb9fa7013762da2eeff8e5.tar.bz2
[gdb/testsuite] Fix gdb.tui/pr30056.exp for native-extended-gdbserver
When running test-case gdb.tui/pr30056.exp with target board native-extended-gdbserver, I run into: ... Quit^[[K^M^[[B(gdb) PASS: gdb.tui/pr30056.exp: Control-C Remote debugging from host ::1, port 38810^M ^M(failed reverse-i-search)`xyz': ^M(gdb) target extended-remote \ localhost:2346^[[7GWARNING: Timed out waiting for EOF in server after \ monitor exit ... This is due to the fact that ^C doesn't abort the reverse-i-search. This appears to be due to a readline problem. A PR is open about this: PR cli/30498. Add a KFAIL for the PR, and ensure that the isearch is aborted by using ^G, such that we have a responsive prompt to handle the "monitor exit" command that native-extended-gdbserver issues. Tested on x86_64-linux.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/gdb.tui/pr30056.exp31
1 files changed, 31 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.tui/pr30056.exp b/gdb/testsuite/gdb.tui/pr30056.exp
index 4ca7a8b..48eaa57 100644
--- a/gdb/testsuite/gdb.tui/pr30056.exp
+++ b/gdb/testsuite/gdb.tui/pr30056.exp
@@ -53,4 +53,35 @@ save_vars { env(LC_ALL) } {
# Send ^C.
send_gdb "\003"
gdb_assert { [Term::wait_for "Quit"] } "Control-C"
+
+ # Uncomment this to simulate that PR cli/30498 is fixed.
+ #send_gdb "\007"
+
+ set test "Control-C aborts isearch"
+
+ # Send "xyz", again.
+ send_gdb "xyz"
+ # Wait for xyx to appear.
+ Term::wait_for_region_contents 0 $Term::_cur_row $Term::_cols 1 "xyz"
+
+ if { [Term::check_region_contents_p 0 $Term::_cur_row $Term::_cols 1 \
+ "^$gdb_prompt xyz"] } {
+ pass $test
+
+ # Send ^C to clear the command line.
+ send_gdb "\003"
+ } else {
+ # Sending ^C currently doesn't abort the i-search. PR cli/30498 is
+ # open about this.
+ kfail cli/30498 $test
+
+ # At this point we don't have a reponsive prompt. Send ^G to abort
+ # the i-search.
+ send_gdb "\007"
+ }
+
+ # We need a reponsive prompt here, to deal with the "monitor exit"
+ # that native-extended-gdbserver will send. Check that we have a
+ # responsive prompt.
+ Term::command "echo \\n"
}