1 # Copyright (C) 2014-2016 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 # A collection of tests related to running execution commands directly
17 # from the command line, with "-ex".
21 if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
25 # Test paginating while printing about the inferior having exited.
27 proc test_paginate_inferior_exited {} {
29 global gdb_prompt pagination_prompt
30 global inferior_exited_re
32 with_test_prefix "paginate" {
33 clean_restart $binfile
35 if ![runto_main] then {
36 fail "Can't run to main"
41 gdb_test_no_output "set height 2"
43 set test "continue to pagination"
45 # Wait for the "Starting program" line, indicating the program
48 gdb_test_multiple "continue" $test {
49 -re "$pagination_prompt" {
63 # We're now stopped in a pagination output while handling a
64 # target event, trying to print about the program exiting.
65 set test "inferior exits normally"
68 gdb_test_multiple "" $test {
69 -re "$inferior_exited_re normally.*$gdb_prompt $" {
74 gdb_test "p 1" " = 1" "GDB accepts further input"
76 # In case the board file wants to send further commands.
77 gdb_test_no_output "set height unlimited"
81 test_paginate_inferior_exited