[PATCH 5/57][Arm][GAS] Add support for MVE instructions: vmull{b,t}
[binutils-gdb.git] / gdb / testsuite / gdb.base / paginate-after-ctrl-c-running.exp
blobe79c46d635a1644b423b35b3b10192aadadb2e7a
1 # Copyright (C) 2014-2019 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 if [target_info exists gdb,nointerrupts] {
17     verbose "Skipping paginate-after-ctrl-c-running.exp because of nointerrupts."
18     return
21 standard_testfile
23 if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
24     return -1
27 # Send a ctrl-c while the target is running and the next output causes
28 # a pagination prompt.
30 proc test_ctrlc_while_target_running_paginates {} {
31     global binfile srcfile
32     global gdb_prompt pagination_prompt
34     set testline [gdb_get_line_number "after sleep"]
36     with_test_prefix "ctrlc target running" {
37         clean_restart $binfile
39         if ![runto_main] then {
40             fail "can't run to main"
41             return 0
42         }
44         gdb_test "b $srcfile:$testline" \
45             "Breakpoint .*$srcfile, line $testline.*" \
46             "set breakpoint"
48         gdb_test_no_output "set height 2"
50         # Wait for the "Continuing" line, indicating the program is
51         # running.
52         set test "continue"
53         gdb_test_multiple $test $test {
54             -re "Continuing" {
55                 pass $test
56             }
57         }
59         # The program sleeps 10 seconds.  Wait just a bit and send a
60         # ctrl-c.
61         sleep 2
62         send_gdb "\003"
64         # GDB now intercepts the SIGINT and tries to let the user know
65         # about the spurious signal, but that paginates.  Make sure
66         # the user can respond to the pagination query.
67         set test "got prompt"
68         set saw_pagination_prompt 0
69         gdb_test_multiple "" $test {
70             -re "$pagination_prompt$" {
71                 set saw_pagination_prompt 1
72                 send_gdb "\n"
73                 exp_continue
74             }
75             -re "$gdb_prompt $" {
76                 gdb_assert $saw_pagination_prompt $test
77             }
78         }
80         # Confirm GDB can still process input.
81         gdb_test "p 1" " = 1" "GDB accepts further input"
83         # In case the board file wants to send further commands.
84         gdb_test_no_output "set height unlimited"
85     }
88 test_ctrlc_while_target_running_paginates