1169691Skan# Copyright 2010-2024 Free Software Foundation, Inc. 2169691Skan 3169691Skan# This program is free software; you can redistribute it and/or modify 4169691Skan# it under the terms of the GNU General Public License as published by 5169691Skan# the Free Software Foundation; either version 3 of the License, or 6169691Skan# (at your option) any later version. 7169691Skan# 8169691Skan# This program is distributed in the hope that it will be useful, 9169691Skan# but WITHOUT ANY WARRANTY; without even the implied warranty of 10169691Skan# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11169691Skan# GNU General Public License for more details. 12169691Skan# 13169691Skan# You should have received a copy of the GNU General Public License 14169691Skan# along with this program. If not, see <http://www.gnu.org/licenses/>. 15169691Skan 16169691Skanrequire allow_cplus_tests 17169691Skan 18169691Skanstandard_testfile .cc 19169691Skan 20169691Skanif { [gdb_compile $srcdir/$subdir/$srcfile $binfile.o object {debug c++}] != ""} { 21169691Skan untested "failed to compile" 22169691Skan return -1 23169691Skan} 24169691Skan 25169691Skanclean_restart $testfile.o 26169691Skan 27169691Skangdb_test_no_output "set width 80" 28169691Skangdb_test_no_output "set height 2" 29169691Skan 30169691Skanset test "print c - <return>" 31169691Skangdb_test_multiple "print c" $test { 32169691Skan -re "\\$\[0-9\]+ = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n--Type <RET>" { 33169691Skan pass $test 34169691Skan } 35169691Skan -re "\r\n--Type <RET>" { 36169691Skan # gdb-7.1 did not crash with this testcase but it had the same bug. 37169691Skan untested "bug does not reproduce" 38169691Skan return 0 39169691Skan } 40169691Skan} 41169691Skan 42169691Skanset test "print c - q <return>" 43169691Skangdb_test_multiple "" $test { 44169691Skan -re " for more, q to quit, " { 45169691Skan pass $test 46169691Skan } 47169691Skan} 48169691Skan 49169691Skanset test "print c - remainder" 50169691Skangdb_test_multiple "" $test { 51169691Skan -re "c to continue without paging--$" { 52169691Skan pass $test 53169691Skan } 54169691Skan} 55169691Skan 56169691Skangdb_test "q" ".*" 57169691Skan 58169691Skan# Now the obstack is uninitialized. Excercise it. 59169691Skan 60169691Skangdb_test_no_output "set pagination off" 61169691Skangdb_test "print c" ".*" "first print" 62169691Skangdb_test "print c" ".*" "second print" 63169691Skan