GDB: trad-frame: Store length of value_bytes in trad_frame_saved_reg
[binutils-gdb.git] / gdb / testsuite / gdb.base / paginate-after-ctrl-c-running.exp
blob1fc70432570eeead8878590f887d965c4a32eab3
1 # Copyright (C) 2014-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 require {!target_info exists gdb,nointerrupts}
18 standard_testfile
20 if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
21 return -1
24 # Send a ctrl-c while the target is running and check that the output
25 # does not cause a pagination prompt.
27 proc test_ctrlc_while_target_running_does_not_paginate {} {
28 global binfile srcfile
29 global gdb_prompt
31 set testline [gdb_get_line_number "after sleep"]
33 with_test_prefix "ctrlc target running" {
34 clean_restart $binfile
36 if {![runto_main]} {
37 return 0
40 gdb_test "b $srcfile:$testline" \
41 "Breakpoint .*$srcfile, line $testline.*" \
42 "set breakpoint"
44 gdb_test_no_output "set height 2"
46 # Wait for the "Continuing" line, indicating the program is
47 # running.
48 set test "continue"
49 gdb_test_multiple $test $test {
50 -re "Continuing" {
51 pass $test
55 # The program sleeps 10 seconds. Wait just a bit and send a
56 # ctrl-c.
57 sleep 2
58 send_gdb "\003"
60 # GDB now intercepts the SIGINT and tries to let the user know
61 # about the spurious signal. Make sure that this does not
62 # trigger pagination.
63 gdb_test_multiple "" "no pagination" {
64 -re "$gdb_prompt $" {
65 pass $gdb_test_name
69 # Confirm GDB can still process input.
70 gdb_test "p 1" " = 1" "GDB accepts further input"
72 # In case the board file wants to send further commands.
73 gdb_test_no_output "set height unlimited"
77 test_ctrlc_while_target_running_does_not_paginate