Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / page.exp
CommitLineData
88b9d363 1# Copyright 1992-2022 Free Software Foundation, Inc.
74cf1395
JM
2
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
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
74cf1395
JM
6# (at your option) any later version.
7#
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.
12#
13# You should have received a copy of the GNU General Public License
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>. */
74cf1395 15
74cf1395
JM
16# This file was written by Fred Fish. (fnf@cygnus.com)
17
74cf1395
JM
18gdb_exit
19gdb_start
b5356753 20
27d3a1a2 21gdb_test_no_output "set pagination off"
b5356753 22gdb_test "show pagination" "State of pagination is off.*" "pagination is off"
5fa290c1 23gdb_test_sequence "help" "unpaged help" {
b5356753
AC
24 "List of classes of commands:"
25 ""
746ebfe8 26 "aliases -- User-defined aliases of other commands"
b5356753
AC
27 "breakpoints -- Making program stop at certain points"
28 "data -- Examining data"
29 "files -- Specifying and examining files"
30 "internals -- Maintenance commands"
31 "obscure -- Obscure features"
32 "running -- Running the program"
33 "stack -- Examining the stack"
34 "status -- Status inquiries"
35 "support -- Support facilities"
36 "tracepoints -- Tracing of program execution without stopping the program"
37 "user-defined -- User-defined commands"
38 ""
39 "Type .help. followed by a class name for a list of commands in that class."
40 "Type .help. followed by command name for full documentation."
41 "Command name abbreviations are allowed if unambiguous."
42}
43
44
27d3a1a2 45gdb_test_no_output "set pagination on"
b5356753 46gdb_test "show pagination" "State of pagination is on.*" "pagination is on"
27d3a1a2 47gdb_test_no_output "set height 10"
b5356753
AC
48send_gdb "help\n"
49gdb_expect_list "paged help" \
eb6af809 50 ".*$pagination_prompt" {
b5356753
AC
51 "List of classes of commands:"
52 ""
746ebfe8 53 "aliases -- User-defined aliases of other commands"
b5356753
AC
54 "breakpoints -- Making program stop at certain points"
55 "data -- Examining data"
56 "files -- Specifying and examining files"
57 "internals -- Maintenance commands"
58 "obscure -- Obscure features"
59 "running -- Running the program"
60}
61gdb_test "q"
62
eb6af809
TT
63gdb_test_no_output "set height 5"
64send_gdb "printf \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\"\n"
65gdb_expect_list "paged count" \
66 ".*$pagination_prompt" {
67 1
68 2
69 3
70 4
71}
72send_gdb "c\n"
73gdb_expect_list "paged count remainder" "${gdb_prompt} " {
74 5
75 6
76 7
77 8
78 9
79 10
80 11
81}
74cf1395 82
a0087920
TT
83set fours [string repeat 4 40]
84set str "1\\n2\\n3\\n$fours\\n5\\n"
85
86# Avoid some confusing output from readline.
87gdb_test_no_output "set editing off"
88
89gdb_test_no_output "set width 30"
90send_gdb "printf \"$str\"\n"
91gdb_expect_list "paged count for interrupt" \
92 ".*$pagination_prompt" \
93 [list 1\r\n 2\r\n 3\r\n 444444444444444444444444444444]
94
95gdb_test "q" "Quit" "quit while paging"
96
8ed25214
PA
97# Check that width/height of sqrt(INT_MAX) is treated as unlimited, as
98# well as "0" and explicit "unlimited".
99foreach_with_prefix size {"0" "0x80000000" "unlimited"} {
100
101 # Alternate between "non-unlimited" values and "unlimited" values,
102 # to make sure we're not seeing stale internal state.
103
104 gdb_test "set width 200"
105 gdb_test "show width" \
106 "Number of characters gdb thinks are in a line is 200\\."
107
108 gdb_test "set height 200"
109 gdb_test "show height" \
110 "Number of lines gdb thinks are in a page is 200\\."
111
112 gdb_test "set width $size"
113 gdb_test "show width unlimited" \
114 "Number of characters gdb thinks are in a line is unlimited\\."
115
116 gdb_test "set height $size"
117 gdb_test "show height unlimited" \
118 "Number of lines gdb thinks are in a page is unlimited\\."
119}
120
5862844d
PA
121gdb_test "set width -1" "integer -1 out of range"
122gdb_test "set height -1" "integer -1 out of range"
123
74cf1395
JM
124gdb_exit
125return 0
126
This page took 2.390067 seconds and 4 git commands to generate.