1 # Copyright 2010-2012 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 { [skip_cplus_tests] } { continue }
18 set testfile static-print-quit
19 set srcfile ${testfile}.cc
20 set executable $testfile.o
21 set objfile ${objdir}/${subdir}/${executable}
23 if { [gdb_compile $srcdir/$subdir/$srcfile $objfile object {debug c++}] != ""} {
24 untested ${testfile}.exp
28 clean_restart $executable
30 gdb_test_no_output "set width 80"
31 gdb_test_no_output "set height 2"
33 set test "print c - <return>"
34 gdb_test_multiple "print c" $test {
35 -re "\\$\[0-9\]+ = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n---Type <return>" {
38 -re "\r\n---Type <return>" {
39 # gdb-7.1 did not crash with this testcase but it had the same bug.
40 untested ${testfile}.exp
45 set test "print c - q <return>"
46 gdb_test_multiple "" $test {
47 -re " to continue, or q <return>" {
52 set test "print c - to quit"
53 gdb_test_multiple "" $test {
61 # Now the obstack is uninitialized. Excercise it.
63 gdb_test_no_output "set pagination off"
64 gdb_test "print c" ".*" "first print"
65 gdb_test "print c" ".*" "second print"