1 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196
4 Index: ./gdb/testsuite/gdb.base/readline-overflow.exp
5 ===================================================================
6 RCS file: ./gdb/testsuite/gdb.base/readline-overflow.exp
7 diff -N ./gdb/testsuite/gdb.base/readline-overflow.exp
8 --- /dev/null 1 Jan 1970 00:00:00 -0000
9 +++ ./gdb/testsuite/gdb.base/readline-overflow.exp 13 Nov 2006 23:42:50 -0000
11 +# Copyright 2006 Free Software Foundation, Inc.
13 +# This program is free software; you can redistribute it and/or modify
14 +# it under the terms of the GNU General Public License as published by
15 +# the Free Software Foundation; either version 2 of the License, or
16 +# (at your option) any later version.
18 +# This program is distributed in the hope that it will be useful,
19 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
20 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 +# GNU General Public License for more details.
23 +# You should have received a copy of the GNU General Public License
24 +# along with this program; if not, write to the Free Software
25 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 +# Please email any bugs, comments, and/or additions to this file to:
28 +# bug-gdb@prep.ai.mit.edu
30 +# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>
32 +# This file is part of the gdb testsuite.
35 +# Tests for readline buffer overflow.
42 +# Don't let a .inputrc file or an existing setting of INPUTRC mess up
43 +# the test results. Even if /dev/null doesn't exist on the particular
44 +# platform, the readline library will use the default setting just by
45 +# failing to open the file. OTOH, opening /dev/null successfully will
46 +# also result in the default settings being used since nothing will be
47 +# read from this file.
49 +if [info exists env(INPUTRC)] {
50 + set old_inputrc $env(INPUTRC)
52 +set env(INPUTRC) "/dev/null"
54 +set oldtimeout1 $timeout
57 +if [info exists env(GDBHISTFILE)] {
58 + set old_gdbhistfile $env(GDBHISTFILE)
60 +if [info exists env(HISTSIZE)] {
61 + set old_histsize $env(HISTSIZE)
63 +set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"
64 +set env(HISTSIZE) "10"
68 +gdb_reinitialize_dir $srcdir/$subdir
72 +gdb_test "set width $width" \
74 + "Setting width to $width."
75 +#gdb_test "set height 1" \
77 +# "Setting height to 1."
80 +# It crashes using `set width 7' on `set total 3560'.
81 +# Sometimes it corrupts screen on `set width 7'.
82 +# Bugreport used `set total 130001':
83 +# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196
84 +# Check also `timeout' above.
98 + fail "gdb sending total $total characters"
99 + note "Failed after sending $i characters, reason: EOF"
100 + gdb_clear_suppressed
103 + fail "gdb sending total $total characters"
104 + note "Failed after sending $i characters (timeout $timeout), reason: TIMEOUT"
105 + gdb_clear_suppressed
108 + fail "gdb sending total $total characters"
109 + note "Failed after sending $i characters, reason: 0=\[$expect_out(0,string)\] buffer=\[$expect_out(buffer)\]"
110 + gdb_clear_suppressed
114 + "No executable file specified..*" \
115 + "All the characters transferred"
118 +# Restore globals modified in this test...
119 +if [info exists old_inputrc] {
120 + set env(INPUTRC) $old_inputrc
124 +if [info exists old_gdbhistfile] {
125 + set env(GDBHISTFILE) $old_gdbhistfile
127 + unset env(GDBHISTFILE)
129 +if [info exists old_histsize] {
130 + set env(HISTSIZE) $old_histsize
132 + unset env(HISTSIZE)
134 +set timeout $oldtimeout1