1 # Copyright 2023-2024 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 # Regression test for PR30056.
18 # This PR is fixed in the in-repo copy of readline. System readline may or
19 # may not be fixed, so skip this test-case.
20 require !with_system_readline
21 require {have_host_locale C.UTF-8}
25 save_vars { env(LC_ALL) } {
29 Term::clean_restart 24 80
32 if {![Term::enter_tui]} {
33 unsupported "TUI not supported"
37 # Send "^R", starting reverse-i-search.
39 Term::wait_for_region_contents 0 $Term::_cur_row $Term::_cols 1 \
40 [string_to_regexp "(reverse-i-search)`': "]
44 Term::wait_for_region_contents 0 $Term::_cur_row $Term::_cols 1 \
45 [string_to_regexp "(failed reverse-i-search)`xyz': "]
50 # We need to the arrow-right to be processed by readline, before we
51 # send the following ^C. Waiting 1 ms seems to do that.
56 gdb_assert { [Term::wait_for "Quit"] } "Control-C"
58 # Uncomment this to simulate that PR cli/30498 is fixed.
61 set test "Control-C aborts isearch"
65 # Wait for xyx to appear.
66 Term::wait_for_region_contents 0 $Term::_cur_row $Term::_cols 1 "xyz"
68 if { [Term::check_region_contents_p 0 $Term::_cur_row $Term::_cols 1 \
69 "^$gdb_prompt xyz"] } {
72 # Send ^C to clear the command line.
75 # Sending ^C currently doesn't abort the i-search. PR cli/30498 is
79 # At this point we don't have a reponsive prompt. Send ^G to abort
84 # We need a reponsive prompt here, to deal with the "monitor exit"
85 # that native-extended-gdbserver will send. Check that we have a
87 Term::command "echo \\n"