Bundle readline-6.2 with a workaround of skipped "ask" (BZ 701131).

Use --without-system-readline, disable Requires and BuildRequires of readline.
Drop gdb-6.5-readline-long-line-crash.patch and gdb-readline-6.0-signal.patch.
This commit is contained in:
Jan Kratochvil 2011-05-02 16:17:50 +02:00
parent f314eb3eb5
commit 7180591ac5
6 changed files with 21310 additions and 447 deletions

View File

@ -1,165 +0,0 @@
Fix Valgrind paste of >= 256 * (screen width) characters (as 130001).
Invalid write of size 4
at 0x8203BD9: rl_redisplay (display.c:812)
by 0x81F5130: _rl_internal_char_cleanup (readline.c:427)
by 0x81F52B3: readline_internal_char (readline.c:508)
by 0x8209817: rl_callback_read_char (callback.c:184)
by 0x8135312: rl_callback_read_char_wrapper (event-top.c:179)
by 0x8135B7B: stdin_event_handler (event-top.c:432)
by 0x81349F2: handle_file_event (event-loop.c:730)
by 0x81342AB: process_event (event-loop.c:343)
by 0x81342F4: gdb_do_one_event (event-loop.c:380)
by 0x81313AC: catch_errors (exceptions.c:515)
by 0x80CE8CA: tui_command_loop (tui-interp.c:151)
by 0x81318B9: current_interp_command_loop (interps.c:278)
Address 0x43DCEB8 is 0 bytes after a block of size 1,024 alloc'd
at 0x4005400: malloc (vg_replace_malloc.c:149)
by 0x8087084: xmalloc (utils.c:959)
by 0x8202CA7: init_line_structures (display.c:440)
by 0x8202D14: rl_redisplay (display.c:471)
by 0x81F4F53: readline_internal_setup (readline.c:363)
by 0x820958C: _rl_callback_newline (callback.c:89)
by 0x82095BB: rl_callback_handler_install (callback.c:101)
by 0x80CE896: tui_command_loop (tui-interp.c:138)
by 0x81318B9: current_interp_command_loop (interps.c:278)
by 0x807E69A: captured_command_loop (main.c:101)
by 0x81313AC: catch_errors (exceptions.c:515)
by 0x807F55A: captured_main (main.c:826)
2006-11-08 Jan Kratochvil <jan.kratochvil@redhat.com>
* readline/display.c (line_state, line_state_array, line_state_visible,
line_state_invisible): Encapsulate _rl_wrapped_line, inv_lbreaks,
inv_lbsize, vis_lbreaks, vis_lbsize, visible_line, invisible_line.
(init_line_structures): Initialize both _rl_wrapped_line ones now.
(rl_redisplay): Fix _rl_wrapped_line handling by using its own size.
Swap whole `line_state_visible' / `line_state_invisible' structures.
(update_line): Update for new `_rl_wrapped_line'.
Index: ./readline/display.c
===================================================================
--- ./readline/display.c 5 May 2006 18:26:12 -0000 1.11
+++ ./readline/display.c 8 Nov 2006 18:23:33 -0000
@@ -73,15 +73,31 @@ static void delete_chars PARAMS((int));
static void insert_some_chars PARAMS((char *, int, int));
static void cr PARAMS((void));
+struct line_state
+ {
+ char *line;
+ int *lbreaks;
+ int lbreaks_size;
+#if defined (HANDLE_MULTIBYTE)
+ int *wrapped_line;
+ int wrapped_line_size;
+#endif
+ };
+static struct line_state line_state_array[2];
+static struct line_state *line_state_visible = &line_state_array[0];
+static struct line_state *line_state_invisible = &line_state_array[1];
+
#if defined (HANDLE_MULTIBYTE)
static int _rl_col_width PARAMS((const char *, int, int));
-static int *_rl_wrapped_line;
#else
# define _rl_col_width(l, s, e) (((e) <= (s)) ? 0 : (e) - (s))
#endif
-static int *inv_lbreaks, *vis_lbreaks;
-static int inv_lbsize, vis_lbsize;
+/* FIXME: Backward compatible naming. */
+#define inv_lbreaks (line_state_invisible->lbreaks)
+#define inv_lbsize (line_state_invisible->lbreaks_size)
+#define vis_lbreaks (line_state_visible->lbreaks)
+#define vis_lbsize (line_state_visible->lbreaks_size)
/* Heuristic used to decide whether it is faster to move from CUR to NEW
by backing up or outputting a carriage return and moving forward. */
@@ -150,8 +166,9 @@ static int last_lmargin;
/* The line display buffers. One is the line currently displayed on
the screen. The other is the line about to be displayed. */
-static char *visible_line = (char *)NULL;
-static char *invisible_line = (char *)NULL;
+/* FIXME: Backward compatible naming. */
+#define visible_line (line_state_visible->line)
+#define invisible_line (line_state_invisible->line)
/* A buffer for `modeline' messages. */
static char msg_buf[128];
@@ -437,7 +454,10 @@ init_line_structures (minsize)
inv_lbreaks = (int *)xmalloc (inv_lbsize * sizeof (int));
vis_lbreaks = (int *)xmalloc (vis_lbsize * sizeof (int));
#if defined (HANDLE_MULTIBYTE)
- _rl_wrapped_line = (int *)xmalloc (vis_lbsize * sizeof (int));
+ line_state_visible->wrapped_line_size = vis_lbsize;
+ line_state_visible->wrapped_line = (int *)xmalloc (line_state_visible->wrapped_line_size * sizeof (int));
+ line_state_invisible->wrapped_line_size = inv_lbsize;
+ line_state_invisible->wrapped_line = (int *)xmalloc (line_state_invisible->wrapped_line_size * sizeof (int));
#endif
inv_lbreaks[0] = vis_lbreaks[0] = 0;
}
@@ -572,10 +592,15 @@ rl_redisplay ()
{ \
inv_lbsize *= 2; \
inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
- _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \
} \
inv_lbreaks[++newlines] = out; \
- _rl_wrapped_line[newlines] = _rl_wrapped_multicolumn; \
+ if (newlines >= (line_state_invisible->wrapped_line_size - 1)) \
+ { \
+ line_state_invisible->wrapped_line_size *= 2; \
+ line_state_invisible->wrapped_line = (int *)xrealloc (line_state_invisible->wrapped_line, \
+ line_state_invisible->wrapped_line_size * sizeof (int)); \
+ } \
+ line_state_invisible->wrapped_line[newlines] = _rl_wrapped_multicolumn; \
lpos = 0; \
} \
} while (0)
@@ -605,7 +630,7 @@ rl_redisplay ()
#endif
#if defined (HANDLE_MULTIBYTE)
- memset (_rl_wrapped_line, 0, vis_lbsize);
+ memset (line_state_invisible->wrapped_line, 0, line_state_invisible->wrapped_line_size * sizeof (int));
num = 0;
#endif
@@ -1118,17 +1143,10 @@ rl_redisplay ()
/* Swap visible and non-visible lines. */
{
- char *vtemp = visible_line;
- int *itemp = vis_lbreaks, ntemp = vis_lbsize;
-
- visible_line = invisible_line;
- invisible_line = vtemp;
-
- vis_lbreaks = inv_lbreaks;
- inv_lbreaks = itemp;
-
- vis_lbsize = inv_lbsize;
- inv_lbsize = ntemp;
+ struct line_state *line_state_temp = line_state_visible;
+
+ line_state_visible = line_state_invisible;
+ line_state_invisible = line_state_temp;
rl_display_fixed = 0;
/* If we are displaying on a single line, and last_lmargin is > 0, we
@@ -1194,8 +1212,9 @@ update_line (old, new, current_line, oma
/* This fixes only double-column characters, but if the wrapped
character comsumes more than three columns, spaces will be
inserted in the string buffer. */
- if (_rl_wrapped_line[current_line] > 0)
- _rl_clear_to_eol (_rl_wrapped_line[current_line]);
+ if (current_line < line_state_visible->wrapped_line_size
+ && line_state_visible->wrapped_line[current_line] > 0)
+ _rl_clear_to_eol (line_state_visible->wrapped_line[current_line]);
memset (&ps, 0, sizeof (mbstate_t));
ret = mbrtowc (&wc, new, MB_CUR_MAX, &ps);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,231 @@
http://sourceware.org/ml/gdb-patches/2011-05/msg00002.html
Subject: [patch] testsuite: Test readline-6.2 "ask" regression
Hi,
this problem does not affect default FSF GDB build as it is using bundled
readline-5.1. But with system readline-6.2 and build using:
--with-system-readline use installed readline library
GDB will no longer ask about displaying too many symbols and dumps them all
immediately.
PASS:
$ gdb gdb
(gdb) p <tab><tab>
Display all 21482 possibilities? (y or n)_
FAIL:
$ gdb gdb
(gdb) p <tab><tab>
Display all 22129 possibilities? (y or n)
../../bfd/aout-target.h cs_to_section
../../bfd/aout32.c ctime
<screens and screens of dumps without any question>
This regression will soon start affecting distros:
FSF GDB HEAD - PASS - using bundled readline-5.1
fedora-15 - FAIL - using system readline-6.2
fedora-14 - PASS - using system readline-6.1
debian-6.0 - PASS - using system readline-6.1
kubuntu-10.10 - PASS - using system readline-6.1
I have asked about it on readline ml:
Re: [Bug-readline] callback mode pager disable status
https://lists.gnu.org/archive/html/bug-readline/2011-04/msg00012.html
The suggested workaround (in fact the readline-5.1 code state) going to patch
into the proposed FSF GDB bundled readline-6.2. Distros then can stop using
--with-system-readline to still feature recent and system matching readline
until readline-7.0 gets released.
This regression has been so far caught only with system debug infos installed:
-PASS: gdb.base/completion.exp: complete (2) 'p no_var_named_this-'
-PASS: gdb.base/completion.exp: complete 'p values[0].a'
-PASS: gdb.base/completion.exp: complete 'p values[0] . a'
-PASS: gdb.base/completion.exp: complete 'p &values[0] -> a'
-PASS: gdb.base/completion.exp: copmletion of field in anonymous union
+FAIL: gdb.base/completion.exp: (timeout) complete (2) 'p no_var_named_this-'
+FAIL: gdb.base/completion.exp: (timeout) complete 'p values[0].a' 2
+FAIL: gdb.base/completion.exp: (timeout) complete 'p values[0] . a' 2
+FAIL: gdb.base/completion.exp: (timeout) complete 'p &values[0] -> a' 2
+FAIL: gdb.base/completion.exp: copmletion of field in anonymous union
I will check it in with no comments.
Thanks,
Jan
gdb/testsuite/
2011-05-01 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/readline-ask.c: New file.
* gdb.base/readline-ask.exp: New file.
* gdb.base/readline-ask.inputrc: New file.
--- /dev/null
+++ b/gdb/testsuite/gdb.base/readline-ask.c
@@ -0,0 +1,23 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2011 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int
+symbol_01_length_40_____________________,
+symbol_02_length_40_____________________,
+symbol_03_length_40_____________________,
+symbol_04_length_40_____________________,
+symbol_10_length_40_____________________;
--- /dev/null
+++ b/gdb/testsuite/gdb.base/readline-ask.exp
@@ -0,0 +1,118 @@
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set testfile readline-ask
+set executable ${testfile}.x
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${executable}
+set inputrc ${srcdir}/${subdir}/${testfile}.inputrc
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } {
+ untested ${testfile}.exp
+ return -1
+}
+
+# INPUTRC gets reset for the next testfile.
+setenv INPUTRC $inputrc
+clean_restart ${executable}
+
+gdb_test_no_output "set width 50"
+gdb_test_no_output "set height 3"
+
+set cmd "p symbol_0"
+send_gdb "$cmd\t"
+set test "bell for more message"
+gdb_test_multiple "" $test {
+ -re "$cmd\007$" {
+ pass $test
+ }
+}
+
+send_gdb "\t"
+set test "more message for 01 and 02"
+gdb_test_multiple "" $test {
+ -re "^\r\nsymbol_01_length_40_____________________\r\nsymbol_02_length_40_____________________\r\n--More--$" {
+ pass $test
+ }
+ -re "$gdb_prompt " {
+ fail $test
+ }
+}
+
+# There get some VT100 characters printed.
+
+send_gdb "\r"
+set test "more message for 03"
+gdb_test_multiple "" $test {
+ -re "\rsymbol_03_length_40_____________________\r\n--More--$" {
+ pass $test
+ }
+}
+
+# "$gdb_prompt $" will not match as $cmd gets output: $gdb_prompt p symbol_0
+# And "$gdb_prompt p symbol_0" cannot be matched as the default "$gdb_prompt $"
+# string from gdb_test_multiple could match earlier.
+
+send_gdb "\r"
+set test "more finish for 04"
+gdb_test_multiple "" $test {
+ -re "\rsymbol_04_length_40_____________________\r\n$gdb_prompt " {
+ pass $test
+ }
+}
+
+gdb_test "foo" {No symbol "symbol_0foo" in current context\.} "abort more message"
+
+set cmd "p symbol_"
+send_gdb "$cmd\t"
+set test "bell for ask message"
+gdb_test_multiple "" $test {
+ -re "$cmd\007$" {
+ pass $test
+ }
+}
+
+send_gdb "\t"
+set test "ask message"
+gdb_test_multiple "" $test {
+ -re "^\r\nDisplay all 5 possibilities\\? \\(y or n\\)$" {
+ pass $test
+ }
+ -re "$gdb_prompt " {
+ fail $test
+ return 0
+ }
+}
+
+send_gdb "y"
+set test "ask message for 01 and 02"
+gdb_test_multiple "" $test {
+ -re "^\r\nsymbol_01_length_40_____________________\r\nsymbol_02_length_40_____________________\r\n--More--$" {
+ pass $test
+ }
+}
+
+# There get some VT100 characters printed.
+# See the "$gdb_prompt " match like in "more finish for 04".
+
+send_gdb "n"
+set test "ask message no"
+gdb_test_multiple "" $test {
+ -re "\r$gdb_prompt " {
+ pass $test
+ }
+}
+
+gdb_test "foo" {No symbol "symbol_foo" in current context\.} "abort ask message"
--- /dev/null
+++ b/gdb/testsuite/gdb.base/readline-ask.inputrc
@@ -0,0 +1,16 @@
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set completion-query-items 5

View File

@ -0,0 +1,117 @@
http://sourceware.org/ml/gdb-patches/2011-05/msg00010.html
Subject: [patch 4/3] readline-6.2: Substitute inc-hist.texinfo
Hi,
forgot the patchset had a `make doc' regression:
make: *** No rule to make target `../../../gdb/doc/../../readline/doc/inc-hist.texinfo', needed by `gdb.info'. Stop.
There was a copy hsuser.texi -> inc-hist.texinfo before with this diff:
@@ -26,9 +26,9 @@ into another language, under the above c
@node Using History Interactively
@chapter Using History Interactively
-@ifclear BashFeatures
-@defcodeindex bt
-@end ifclear
+@c @ifclear BashFeatures
+@c @defcodeindex bt
+@c @end ifclear
@ifset BashFeatures
This chapter describes how to use the @sc{gnu} History Library
@@ -39,9 +39,9 @@ see the @sc{gnu} Readline Library Manual
@end ifset
@ifclear BashFeatures
This chapter describes how to use the @sc{gnu} History Library interactively,
-from a user's standpoint. It should be considered a user's guide. For
-information on using the @sc{gnu} History Library in your own programs,
-@pxref{Programming with GNU History}.
+from a user's standpoint. It should be considered a user's guide.
+For information on using the @sc{gnu} History Library in other programs,
+see the @sc{gnu} Readline Library Manual.
@end ifclear
@ifset BashFeatures
Used slightly alternative one with IMO better reference and I have also kept
hsuser.texi in place as readline/ in src/ is no longer a standalone readline
distribution anyway.
Sorry,
Jan
gdb/doc/
2011-05-02 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.in (GDB_DOC_SOURCE_INCLUDES): Rename inc-hist.texinfo to
hsuser.texi.
* gdb.texinfo <!SYSTEM_READLINE>: Rename inc-hist.texinfo inclusion and
comment to hsuser.texi. Change rluser.texi name in the comment.
readline/doc/
2011-05-02 Jan Kratochvil <jan.kratochvil@redhat.com>
* hsuser.texi (Using History Interactively): Disable !BashFeatures
@defcodeindex. Make the `Programming with GNU History' reference
external.
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -117,7 +117,7 @@ GDB_DOC_SOURCE_INCLUDES = \
$(srcdir)/gpl.texi \
$(srcdir)/agentexpr.texi \
$(READLINE_DIR)/rluser.texi \
- $(READLINE_DIR)/inc-hist.texinfo
+ $(READLINE_DIR)/hsuser.texi
GDB_DOC_BUILD_INCLUDES = \
gdb-cfg.texi \
GDBvn.texi
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -31008,13 +31008,13 @@ things without first using the debugger to find the facts.
@c The readline documentation is distributed with the readline code
@c and consists of the two following files:
-@c rluser.texinfo
-@c inc-hist.texinfo
+@c rluser.texi
+@c hsuser.texi
@c Use -I with makeinfo to point to the appropriate directory,
@c environment var TEXINPUTS with TeX.
@ifclear SYSTEM_READLINE
@include rluser.texi
-@include inc-hist.texinfo
+@include hsuser.texi
@end ifclear
--- a/readline/doc/hsuser.texi
+++ b/readline/doc/hsuser.texi
@@ -26,9 +26,10 @@ into another language, under the above conditions for modified versions.
@node Using History Interactively
@chapter Using History Interactively
-@ifclear BashFeatures
-@defcodeindex bt
-@end ifclear
+@c GDB bundling modification:
+@c @ifclear BashFeatures
+@c @defcodeindex bt
+@c @end ifclear
@ifset BashFeatures
This chapter describes how to use the @sc{gnu} History Library
@@ -41,7 +42,8 @@ see the @sc{gnu} Readline Library Manual.
This chapter describes how to use the @sc{gnu} History Library interactively,
from a user's standpoint. It should be considered a user's guide. For
information on using the @sc{gnu} History Library in your own programs,
-@pxref{Programming with GNU History}.
+@c GDB bundling modification:
+@pxref{Programming with GNU History, , , history, GNU History Library}.
@end ifclear
@ifset BashFeatures

View File

@ -1,266 +0,0 @@
http://sourceware.org/ml/gdb-patches/2009-11/msg00596.html
Subject: [gdb FYI-patch] callback-mode readline-6.0 regression
Hi Chet,
FSF GDB currently ships bundled with readline-5.2 which works fine.
But using --with-system-readline and readline-6.0-patchlevel4 has
a regression:
readline-5.2: Run `gdb -nx -q' and type CTRL-C:
(gdb) Quit
(gdb) _
readline-6.0: Run `gdb -nx -q' and type CTRL-C:
(gdb) _
= nothing happens (it gets buffered and executed later)
(It does also FAIL on gdb.gdb/selftest.exp.)
It is because GDB waits in its own poll() mainloop and readline uses via
rl_callback_handler_install and rl_callback_handler_remove. This way the
readline internal variable _rl_interrupt_immediately remains 0 and CTRL-C gets
only stored to _rl_caught_signal but not executed.
Seen in rl_signal_handler even if _rl_interrupt_immediately is set and
_rl_handle_signal is called then the signal is still stored to
_rl_caught_signal. In the _rl_interrupt_immediately case it should not be
stored when it was already processed.
rl_signal_handler does `_rl_interrupt_immediately = 0;' - while I am not aware
of its meaning it breaks the nest-counting of other routines which do
`_rl_interrupt_immediately++;' and `_rl_interrupt_immediately--;' possibly
creating problematic `_rl_interrupt_immediately == -1'.
`_rl_interrupt_immediately' is an internal variable, how it could be accessed
by a readline application? (OK, maybe it should not be used.)
Attaching a current GDB-side patch but it must access readline internal
variable _rl_caught_signal and it is generally just a workaround. Could you
please include support for signals in this asynchronous mode in readline-6.1?
I find it would be enough to make RL_CHECK_SIGNALS public?
GDB: No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
But this is not a patch intended to be accepted.
Thanks,
Jan
gdb/
2009-11-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* config.in, configure: Regenerate.
* configure.ac (for readline_echoing_p): Move inside $LIBS change.
(for _rl_caught_signal): New.
* event-loop.c: Include readline/readline.h.
(gdb_do_one_event) [HAVE_READLINE_CAUGHT_SIGNAL]: New.
gdb/testsuite/
2009-11-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.gdb/selftest.exp (backtrace through signal handler): Move before
SIGINT pass, drop the timeout case.
(send SIGINT signal to child process): Use gdb_test.
(backtrace through readline handler): New.
Index: gdb-7.2.50.20110107/gdb/config.in
===================================================================
--- gdb-7.2.50.20110107.orig/gdb/config.in 2011-01-17 15:36:40.000000000 +0100
+++ gdb-7.2.50.20110107/gdb/config.in 2011-01-17 15:37:09.000000000 +0100
@@ -464,6 +464,9 @@
/* Define to 1 if wcwidth is declared even after undefining macros. */
#undef HAVE_RAW_DECL_WCWIDTH
+/* readline-6.0 workaround of blocked signals. */
+#undef HAVE_READLINE_CAUGHT_SIGNAL
+
/* Define to 1 if you have the `realpath' function. */
#undef HAVE_REALPATH
Index: gdb-7.2.50.20110107/gdb/configure.ac
===================================================================
--- gdb-7.2.50.20110107.orig/gdb/configure.ac 2011-01-17 15:36:42.000000000 +0100
+++ gdb-7.2.50.20110107/gdb/configure.ac 2011-01-17 15:37:09.000000000 +0100
@@ -736,17 +736,25 @@ if test "$with_system_readline" = yes; t
# readline-6.0 started to use the name `_rl_echoing_p'.
# `$(READLINE_DIR)/' of bundled readline would not resolve in configure.
- AC_MSG_CHECKING([for readline_echoing_p])
save_LIBS=$LIBS
LIBS="$LIBS $READLINE"
+ AC_MSG_CHECKING([for readline_echoing_p])
AC_LINK_IFELSE(AC_LANG_PROGRAM(,[[extern int readline_echoing_p;
return readline_echoing_p;]]),
[READLINE_ECHOING_P=yes],
[READLINE_ECHOING_P=no
AC_DEFINE([readline_echoing_p], [_rl_echoing_p],
[readline-6.0 started to use different name.])])
- LIBS="$save_LIBS"
AC_MSG_RESULT([$READLINE_ECHOING_P])
+ AC_MSG_CHECKING([for _rl_caught_signal])
+ AC_LINK_IFELSE(AC_LANG_PROGRAM(,[[extern int volatile _rl_caught_signal;
+ return _rl_caught_signal;]]),
+ [READLINE_CAUGHT_SIGNAL=yes
+ AC_DEFINE([HAVE_READLINE_CAUGHT_SIGNAL],,
+ [readline-6.0 workaround of blocked signals.])],
+ [READLINE_CAUGHT_SIGNAL=no])
+ AC_MSG_RESULT([$READLINE_CAUGHT_SIGNAL])
+ LIBS="$save_LIBS"
else
READLINE='$(READLINE_DIR)/libreadline.a'
READLINE_DEPS='$(READLINE)'
Index: gdb-7.2.50.20110107/gdb/event-loop.c
===================================================================
--- gdb-7.2.50.20110107.orig/gdb/event-loop.c 2011-01-05 23:22:48.000000000 +0100
+++ gdb-7.2.50.20110107/gdb/event-loop.c 2011-01-17 15:37:23.000000000 +0100
@@ -37,6 +37,7 @@
#include "exceptions.h"
#include "gdb_assert.h"
#include "gdb_select.h"
+#include "readline/readline.h"
/* Tell create_file_handler what events we are interested in.
This is used by the select version of the event loop. */
@@ -419,6 +420,9 @@ gdb_do_one_event (void *data)
static int event_source_head = 0;
const int number_of_sources = 3;
int current = 0;
+#ifdef HAVE_READLINE_CAUGHT_SIGNAL
+ extern int volatile _rl_caught_signal;
+#endif
/* Any events already waiting in the queue? */
if (process_event ())
@@ -463,6 +467,29 @@ gdb_do_one_event (void *data)
if (gdb_wait_for_event (1) < 0)
return -1;
+#ifdef HAVE_READLINE_CAUGHT_SIGNAL
+ if (async_command_editing_p && RL_ISSTATE (RL_STATE_CALLBACK)
+ && _rl_caught_signal)
+ {
+ char *prompt;
+
+ if (rl_prompt == NULL)
+ {
+ /* Should not happen, defensive only. */
+ prompt = "";
+ }
+ else
+ {
+ prompt = alloca (strlen (rl_prompt) + 1);
+ strcpy (prompt, rl_prompt);
+ }
+
+ /* Call RL_CHECK_SIGNALS this way. */
+ rl_callback_handler_remove ();
+ rl_callback_handler_install (prompt, input_handler);
+ }
+#endif
+
/* Handle any new events occurred while waiting. */
if (process_event ())
return 1;
Index: gdb-7.2.50.20110107/gdb/testsuite/gdb.gdb/selftest.exp
===================================================================
--- gdb-7.2.50.20110107.orig/gdb/testsuite/gdb.gdb/selftest.exp 2011-01-17 15:36:37.000000000 +0100
+++ gdb-7.2.50.20110107/gdb/testsuite/gdb.gdb/selftest.exp 2011-01-17 15:37:09.000000000 +0100
@@ -433,6 +433,28 @@ proc test_with_self { executable } {
}
}
+ # get a stack trace with the poll function
+ #
+ # This fails on some linux systems for unknown reasons. On the
+ # systems where it fails, sometimes it works fine when run manually.
+ # The testsuite failures may not be limited to just aout systems.
+ setup_xfail "i*86-pc-linuxaout-gnu"
+ set description "backtrace through signal handler"
+ gdb_test_multiple "backtrace" "$description" {
+ -re "#0.*(read|poll).*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
+ pass "$description"
+ }
+ -re ".*$gdb_prompt $" {
+ # On the alpha, we hit the infamous problem about gdb
+ # being unable to get the frame pointer (mentioned in
+ # gdb/README). As it is intermittent, there is no way to
+ # XFAIL it which will give us an XPASS if the problem goes
+ # away.
+ setup_xfail "alpha*-*-osf*"
+ fail "$description"
+ }
+ }
+
set description "send SIGINT signal to child process"
gdb_test "signal SIGINT" \
"Continuing with signal SIGINT.*" \
@@ -443,10 +465,11 @@ proc test_with_self { executable } {
# This fails on some linux systems for unknown reasons. On the
# systems where it fails, sometimes it works fine when run manually.
# The testsuite failures may not be limited to just aout systems.
+ # Optional system readline may not have symbols to be shown.
setup_xfail "i*86-pc-linuxaout-gnu"
- set description "backtrace through signal handler"
+ set description "backtrace through readline handler"
gdb_test_multiple "backtrace" "$description" {
- -re "#0.*(read|poll).*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
+ -re "#0.*gdb_do_one_event.*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
pass "$description"
}
-re ".*$gdb_prompt $" {
Index: gdb-7.2.50.20110107/gdb/configure
===================================================================
--- gdb-7.2.50.20110107.orig/gdb/configure 2011-01-17 15:36:42.000000000 +0100
+++ gdb-7.2.50.20110107/gdb/configure 2011-01-17 15:37:09.000000000 +0100
@@ -10237,10 +10237,10 @@ if test "$with_system_readline" = yes; t
# readline-6.0 started to use the name `_rl_echoing_p'.
# `$(READLINE_DIR)/' of bundled readline would not resolve in configure.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline_echoing_p" >&5
-$as_echo_n "checking for readline_echoing_p... " >&6; }
save_LIBS=$LIBS
LIBS="$LIBS $READLINE"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline_echoing_p" >&5
+$as_echo_n "checking for readline_echoing_p... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -10263,9 +10263,35 @@ $as_echo "#define readline_echoing_p _rl
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- LIBS="$save_LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINE_ECHOING_P" >&5
$as_echo "$READLINE_ECHOING_P" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _rl_caught_signal" >&5
+$as_echo_n "checking for _rl_caught_signal... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+extern int volatile _rl_caught_signal;
+ return _rl_caught_signal;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ READLINE_CAUGHT_SIGNAL=yes
+
+$as_echo "#define HAVE_READLINE_CAUGHT_SIGNAL /**/" >>confdefs.h
+
+else
+ READLINE_CAUGHT_SIGNAL=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINE_CAUGHT_SIGNAL" >&5
+$as_echo "$READLINE_CAUGHT_SIGNAL" >&6; }
+ LIBS="$save_LIBS"
else
READLINE='$(READLINE_DIR)/libreadline.a'
READLINE_DEPS='$(READLINE)'

View File

@ -27,7 +27,7 @@ Version: 7.2.90.20110429
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 35%{?_with_upstream:.upstream}%{?dist}
Release: 36%{?_with_upstream:.upstream}%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain
Group: Development/Debuggers
@ -231,8 +231,6 @@ Patch211: gdb-6.5-last-address-space-byte-test.patch
Patch208: gdb-6.5-BEA-testsuite.patch
# Fix readline segfault on excessively long hand-typed lines.
#=drop: After upstream's readline rebase it will be obsolete.
Patch209: gdb-6.5-readline-long-line-crash.patch
#=fedoratest
Patch213: gdb-6.5-readline-long-line-crash-test.patch
@ -417,9 +415,6 @@ Patch381: gdb-simultaneous-step-resume-breakpoint-test.patch
#=push+work: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*>
Patch382: gdb-core-open-vdso-warning.patch
# Fix callback-mode readline-6.0 regression for CTRL-C (for RHEL-6.0).
Patch390: gdb-readline-6.0-signal.patch
# Fix syscall restarts for amd64->i386 biarch.
#=push
Patch391: gdb-x86_64-i386-syscall-restart.patch
@ -570,9 +565,15 @@ Patch589: gdb-optim-g-prologue-skip.patch
# Fix physname-related CU expansion issue for C++ (PR 12708).
Patch590: gdb-physname-expand-completer.patch
# Bundle readline-6.2 with a workaround of skipped "ask" (BZ 701131).
Patch591: gdb-bz701131-readline62-1of3.patch
Patch592: gdb-bz701131-readline62-2of3.patch
Patch593: gdb-bz701131-readline62-3of3.patch
BuildRequires: ncurses-devel%{?_isa} texinfo gettext flex bison expat-devel%{?_isa}
Requires: readline%{?_isa}
BuildRequires: readline-devel%{?_isa}
# --without-system-readline
# Requires: readline%{?_isa}
# BuildRequires: readline-devel%{?_isa}
%if 0%{!?el5:1}
# dlopen() no longer makes rpm-libs a mandatory dependency.
#Requires: rpm-libs%{?_isa}
@ -758,7 +759,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch196 -p1
%patch199 -p1
%patch208 -p1
%patch209 -p1
%patch211 -p1
%patch213 -p1
%patch214 -p1
@ -846,15 +846,12 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch588 -p1
%patch589 -p1
%patch590 -p1
%patch591 -p1
%patch592 -p1
%patch593 -p1
%patch390 -p1
%patch393 -p1
%patch335 -p1
readline="$(readlink -f %{_libdir}/libreadline.so)"
if [ "$readline" = "${readline%/libreadline.so.6.0}" ]
then
%patch390 -p1 -R
fi
%if 0%{!?el5:1}
%patch393 -p1 -R
%patch335 -p1 -R
@ -932,7 +929,7 @@ CFLAGS="$CFLAGS -O0 -ggdb2"
--with-separate-debug-dir=/usr/lib/debug \
--disable-sim \
--disable-rpath \
--with-system-readline \
--without-system-readline \
--with-expat \
$(: ppc64 host build crashes on ppc variant of libexpat.so ) \
--without-libexpat-prefix \
@ -1274,6 +1271,11 @@ fi
%{_infodir}/gdb.info*
%changelog
* Mon May 2 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110429-36.fc15
- Bundle readline-6.2 with a workaround of skipped "ask" (BZ 701131).
- Use --without-system-readline, disable Requires and BuildRequires of readline.
- Drop gdb-6.5-readline-long-line-crash.patch and gdb-readline-6.0-signal.patch.
* Fri Apr 29 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110429-35.fc15
- Rebase to FSF GDB 7.2.90.20110429 (which is a 7.3 pre-release).
- Fix -O2 -g breakpoints internal error + prologue skipping (BZ 612253).