public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] [gdb/testsuite] Fix gdb.tui/pr30056.exp for native-extended-gdbserver
@ 2023-05-31 13:07 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2023-05-31 13:07 UTC (permalink / raw)
  To: gdb-patches

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.
---
 gdb/testsuite/gdb.tui/pr30056.exp | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gdb/testsuite/gdb.tui/pr30056.exp b/gdb/testsuite/gdb.tui/pr30056.exp
index 4ca7a8b56a8..48eaa5735b8 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"
 }

base-commit: 768d1d879be2d134e049521f28d4d5e03b69bafc
-- 
2.35.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-31 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-31 13:07 [pushed] [gdb/testsuite] Fix gdb.tui/pr30056.exp for native-extended-gdbserver Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).