]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-bz701131-readline62-2of3.patch
- rel 2
[packages/gdb.git] / gdb-bz701131-readline62-2of3.patch
CommitLineData
6ed6bacf
AM
1http://sourceware.org/ml/gdb-patches/2011-05/msg00002.html
2Subject: [patch] testsuite: Test readline-6.2 "ask" regression
3
4Hi,
5
6this problem does not affect default FSF GDB build as it is using bundled
7readline-5.1. But with system readline-6.2 and build using:
8 --with-system-readline use installed readline library
9
10GDB will no longer ask about displaying too many symbols and dumps them all
11immediately.
12PASS:
13 $ gdb gdb
14 (gdb) p <tab><tab>
15 Display all 21482 possibilities? (y or n)_
16FAIL:
17 $ gdb gdb
18 (gdb) p <tab><tab>
19 Display all 22129 possibilities? (y or n)
20 ../../bfd/aout-target.h cs_to_section
21 ../../bfd/aout32.c ctime
22 <screens and screens of dumps without any question>
23
24This regression will soon start affecting distros:
25 FSF GDB HEAD - PASS - using bundled readline-5.1
26 fedora-15 - FAIL - using system readline-6.2
27 fedora-14 - PASS - using system readline-6.1
28 debian-6.0 - PASS - using system readline-6.1
29 kubuntu-10.10 - PASS - using system readline-6.1
30
31I have asked about it on readline ml:
32 Re: [Bug-readline] callback mode pager disable status
33 https://lists.gnu.org/archive/html/bug-readline/2011-04/msg00012.html
34The suggested workaround (in fact the readline-5.1 code state) going to patch
35into the proposed FSF GDB bundled readline-6.2. Distros then can stop using
36--with-system-readline to still feature recent and system matching readline
37until readline-7.0 gets released.
38
39This regression has been so far caught only with system debug infos installed:
40 -PASS: gdb.base/completion.exp: complete (2) 'p no_var_named_this-'
41 -PASS: gdb.base/completion.exp: complete 'p values[0].a'
42 -PASS: gdb.base/completion.exp: complete 'p values[0] . a'
43 -PASS: gdb.base/completion.exp: complete 'p &values[0] -> a'
44 -PASS: gdb.base/completion.exp: copmletion of field in anonymous union
45 +FAIL: gdb.base/completion.exp: (timeout) complete (2) 'p no_var_named_this-'
46 +FAIL: gdb.base/completion.exp: (timeout) complete 'p values[0].a' 2
47 +FAIL: gdb.base/completion.exp: (timeout) complete 'p values[0] . a' 2
48 +FAIL: gdb.base/completion.exp: (timeout) complete 'p &values[0] -> a' 2
49 +FAIL: gdb.base/completion.exp: copmletion of field in anonymous union
50
51I will check it in with no comments.
52
53
54Thanks,
55Jan
56
57
58gdb/testsuite/
592011-05-01 Jan Kratochvil <jan.kratochvil@redhat.com>
60
61 * gdb.base/readline-ask.c: New file.
62 * gdb.base/readline-ask.exp: New file.
63 * gdb.base/readline-ask.inputrc: New file.
64
65--- /dev/null
66+++ b/gdb/testsuite/gdb.base/readline-ask.c
67@@ -0,0 +1,23 @@
68+/* This testcase is part of GDB, the GNU debugger.
69+
70+ Copyright 2011 Free Software Foundation, Inc.
71+
72+ This program is free software; you can redistribute it and/or modify
73+ it under the terms of the GNU General Public License as published by
74+ the Free Software Foundation; either version 3 of the License, or
75+ (at your option) any later version.
76+
77+ This program is distributed in the hope that it will be useful,
78+ but WITHOUT ANY WARRANTY; without even the implied warranty of
79+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
80+ GNU General Public License for more details.
81+
82+ You should have received a copy of the GNU General Public License
83+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
84+
85+int
86+symbol_01_length_40_____________________,
87+symbol_02_length_40_____________________,
88+symbol_03_length_40_____________________,
89+symbol_04_length_40_____________________,
90+symbol_10_length_40_____________________;
91--- /dev/null
92+++ b/gdb/testsuite/gdb.base/readline-ask.exp
93@@ -0,0 +1,118 @@
94+# Copyright (C) 2011 Free Software Foundation, Inc.
95+#
96+# This program is free software; you can redistribute it and/or modify
97+# it under the terms of the GNU General Public License as published by
98+# the Free Software Foundation; either version 3 of the License, or
99+# (at your option) any later version.
100+#
101+# This program is distributed in the hope that it will be useful,
102+# but WITHOUT ANY WARRANTY; without even the implied warranty of
103+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
104+# GNU General Public License for more details.
105+#
106+# You should have received a copy of the GNU General Public License
107+# along with this program. If not, see <http://www.gnu.org/licenses/>.
108+
109+set testfile readline-ask
110+set executable ${testfile}.x
111+set srcfile ${testfile}.c
112+set binfile ${objdir}/${subdir}/${executable}
113+set inputrc ${srcdir}/${subdir}/${testfile}.inputrc
114+
115+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } {
116+ untested ${testfile}.exp
117+ return -1
118+}
119+
120+# INPUTRC gets reset for the next testfile.
121+setenv INPUTRC $inputrc
122+clean_restart ${executable}
123+
124+gdb_test_no_output "set width 50"
125+gdb_test_no_output "set height 3"
126+
127+set cmd "p symbol_0"
128+send_gdb "$cmd\t"
129+set test "bell for more message"
130+gdb_test_multiple "" $test {
131+ -re "$cmd\007$" {
132+ pass $test
133+ }
134+}
135+
136+send_gdb "\t"
137+set test "more message for 01 and 02"
138+gdb_test_multiple "" $test {
139+ -re "^\r\nsymbol_01_length_40_____________________\r\nsymbol_02_length_40_____________________\r\n--More--$" {
140+ pass $test
141+ }
142+ -re "$gdb_prompt " {
143+ fail $test
144+ }
145+}
146+
147+# There get some VT100 characters printed.
148+
149+send_gdb "\r"
150+set test "more message for 03"
151+gdb_test_multiple "" $test {
152+ -re "\rsymbol_03_length_40_____________________\r\n--More--$" {
153+ pass $test
154+ }
155+}
156+
157+# "$gdb_prompt $" will not match as $cmd gets output: $gdb_prompt p symbol_0
158+# And "$gdb_prompt p symbol_0" cannot be matched as the default "$gdb_prompt $"
159+# string from gdb_test_multiple could match earlier.
160+
161+send_gdb "\r"
162+set test "more finish for 04"
163+gdb_test_multiple "" $test {
164+ -re "\rsymbol_04_length_40_____________________\r\n$gdb_prompt " {
165+ pass $test
166+ }
167+}
168+
169+gdb_test "foo" {No symbol "symbol_0foo" in current context\.} "abort more message"
170+
171+set cmd "p symbol_"
172+send_gdb "$cmd\t"
173+set test "bell for ask message"
174+gdb_test_multiple "" $test {
175+ -re "$cmd\007$" {
176+ pass $test
177+ }
178+}
179+
180+send_gdb "\t"
181+set test "ask message"
182+gdb_test_multiple "" $test {
183+ -re "^\r\nDisplay all 5 possibilities\\? \\(y or n\\)$" {
184+ pass $test
185+ }
186+ -re "$gdb_prompt " {
187+ fail $test
188+ return 0
189+ }
190+}
191+
192+send_gdb "y"
193+set test "ask message for 01 and 02"
194+gdb_test_multiple "" $test {
195+ -re "^\r\nsymbol_01_length_40_____________________\r\nsymbol_02_length_40_____________________\r\n--More--$" {
196+ pass $test
197+ }
198+}
199+
200+# There get some VT100 characters printed.
201+# See the "$gdb_prompt " match like in "more finish for 04".
202+
203+send_gdb "n"
204+set test "ask message no"
205+gdb_test_multiple "" $test {
206+ -re "\r$gdb_prompt " {
207+ pass $test
208+ }
209+}
210+
211+gdb_test "foo" {No symbol "symbol_foo" in current context\.} "abort ask message"
212--- /dev/null
213+++ b/gdb/testsuite/gdb.base/readline-ask.inputrc
214@@ -0,0 +1,16 @@
215+# Copyright (C) 2011 Free Software Foundation, Inc.
216+#
217+# This program is free software; you can redistribute it and/or modify
218+# it under the terms of the GNU General Public License as published by
219+# the Free Software Foundation; either version 3 of the License, or
220+# (at your option) any later version.
221+#
222+# This program is distributed in the hope that it will be useful,
223+# but WITHOUT ANY WARRANTY; without even the implied warranty of
224+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
225+# GNU General Public License for more details.
226+#
227+# You should have received a copy of the GNU General Public License
228+# along with this program. If not, see <http://www.gnu.org/licenses/>.
229+
230+set completion-query-items 5
231
This page took 0.209633 seconds and 4 git commands to generate.