old-cross-binutils/gdb/tui
Patrick Palka 8900d71e38 Explicitly call rl_resize_terminal() in TUI's SIGWINCH handler
In readline 6.3, the semantics of SIGWINCH handling has changed.
When a SIGWINCH signal is raised, readline's rl_sigwinch_handler() now
does not immediately call rl_resize_terminal().  Instead it sets a flag
that is checked by RL_CHECK_SIGNALS() at a point where readline has
control, and calls rl_resize_terminal() if said flag is set.

This change is item (c) in https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES

  c.  Fixed a bug that caused readline to try and run code to modify its idea
      of the screen size in a signal handler context upon receiving a SIGWINCH.

This change in behavior is important to us because TUI's
tui_sigwinch_handler() relies on the assumption that by the time it's
called, readline will have updated its knowledge of the terminal
dimensions via rl_resize_terminal().  Since this assumption no longer
holds true, TUI's SIGWINCH handling does not work correctly with
readline 6.3.

To fix this issue this patch makes TUI explicitly call
rl_resize_terminal() in tui_async_resize_screen() at the point where
current terminal dimensions are needed.  (We could call it in
tui_sigwinch_handler too, but since readline avoids doing it, we are
probably safer off avoiding to call it in signal handler context as
well.)  After this change, SIGWINCH handling continues to work properly
with both readline 6.2 and 6.3.

Since we no longer need it, we could now explicitly disable readline's
SIGWINCH handler by setting rl_catch_sigwinch to zero early on in the
program startup but I can't seem to find a good spot to place this
assignment (the first call to rl_initialize() occurs in
tui_initialize_readline() so the assignment should occur before then),
and the handler is harmless anyway.

gdb/ChangeLog:

	* tui/tui-win.c (tui_async_resize_screen): Call
	rl_resize_terminal().
2015-04-23 08:00:55 -04:00
..
ChangeLog-1998-2003
tui-command.c Speed up GDB's TUI output 2015-02-04 12:27:28 +01:00
tui-command.h Speed up GDB's TUI output 2015-02-04 12:27:28 +01:00
tui-data.c New common function "startswith" 2015-03-06 09:42:06 +00:00
tui-data.h Fix struct, union, and enum nesting in C++ 2015-02-27 17:19:15 +00:00
tui-disasm.c
tui-disasm.h
tui-file.c Speed up GDB's TUI output 2015-02-04 12:27:28 +01:00
tui-file.h
tui-hooks.c Consolidate the custom TUI query hook with the default query hook 2015-01-09 13:27:56 -05:00
tui-hooks.h
tui-interp.c
tui-io.c Fix undefined behavior in TUI's TAB expansion 2015-03-21 10:48:34 +02:00
tui-io.h Make sure TABs are expanded in TUI windows on MS-Windows. 2015-01-31 10:47:14 +02:00
tui-layout.c Remove --xdb 2015-04-11 19:49:03 +02:00
tui-layout.h
tui-out.c
tui-regs.c Remove --xdb 2015-04-11 19:49:03 +02:00
tui-regs.h
tui-source.c
tui-source.h
tui-stack.c
tui-stack.h
tui-win.c Explicitly call rl_resize_terminal() in TUI's SIGWINCH handler 2015-04-23 08:00:55 -04:00
tui-win.h Really add a prototype for tui_rehighlight_all. 2015-01-16 19:58:04 +02:00
tui-windata.c C++ keyword cleanliness, mostly auto-generated 2015-02-27 16:33:07 +00:00
tui-windata.h
tui-wingeneral.c Do not increment of decrement enums 2015-02-27 17:29:11 +00:00
tui-wingeneral.h
tui-winsource.c
tui-winsource.h
tui.c Split TRY_CATCH into TRY + CATCH 2015-03-07 15:14:14 +00:00
tui.h