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.
# 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"
}