public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* Test results for commit f8e5e23e3dc46042fcf5fad6013e6fa8db13ec43 on branch master
@ 2015-02-17 11:22 sergiodj
  2015-02-17 11:33 ` Failures on Fedora-ppc64be-cc-with-index, " sergiodj
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: sergiodj @ 2015-02-17 11:22 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT f8e5e23e3dc46042fcf5fad6013e6fa8db13ec43 ***

Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: f8e5e23e3dc46042fcf5fad6013e6fa8db13ec43

TUI: resize windows to new terminal size before displaying them
If the user:

   #1 - disables the TUI
   #2 - resizes the terminal
   #3 - and then re-enables the TUI

the next wgetch() returns KEY_RESIZE.  This indicates to the ncurses
client that ncurses detected that the terminal has been resized.  We
don't handle KEY_RESIZE anywhere, so it gets passed on to readline
which interprets it as a multibyte character, and then the end result
is that the first key press after enabling the TUI is misinterpreted.

We shouldn't really need to handle KEY_RESIZE (and not all ncurses
implementations have that).  We have our own SIGWINCH handler, and,
when we re-enable the TUI, we explicitly detect terminal resizes and
resize all windows.  The reason ncurses currently does detects a
resize is that something within tui_enable forces a refresh/display of
some window before we get to do the actual resizing.  Setting a break
on ncurses' 'resizeterm' function helps find the culprit(s):

 (top-gdb) bt
 #0  resizeterm (ToLines=28, ToCols=114) at ../../ncurses/base/resizeterm.c:462
 #1  0x0000003b42812f3f in _nc_update_screensize (sp=0x2674730) at ../../ncurses/tinfo/lib_setup.c:443
 #2  0x0000003b0821cbe0 in doupdate () at ../../ncurses/tty/tty_update.c:726
 #3  0x0000003b08215539 in wrefresh (win=0x2a7bc00) at ../../ncurses/base/lib_refresh.c:65
 #4  0x00000000005257cb in tui_refresh_win (win_info=0xd73d60 <_locator>) at /home/pedro/gdb/mygit/src/gdb/tui/tui-wingeneral.c:60
 #5  0x000000000052265b in tui_show_locator_content () at /home/pedro/gdb/mygit/src/gdb/tui/tui-stack.c:269
 #6  0x00000000005273a6 in tui_set_key_mode (mode=TUI_COMMAND_MODE) at /home/pedro/gdb/mygit/src/gdb/tui/tui.c:321
 #7  0x00000000005278c7 in tui_enable () at /home/pedro/gdb/mygit/src/gdb/tui/tui.c:494
 #8  0x0000000000527011 in tui_rl_switch_mode (notused1=1, notused2=1) at /home/pedro/gdb/mygit/src/gdb/tui/tui.c:108

That is, tui_enable calls tui_set_key_mode before we've resized all
windows, and that refreshes a window as side effect.

And if we're already debugging something (there's a frame), then we'll
instead show a window from within tui_show_frame_info:

 (top-gdb) bt
 #0  resizeterm (ToLines=28, ToCols=114) at ../../ncurses/base/resizeterm.c:462
 #1  0x0000003b42812f3f in _nc_update_screensize (sp=0x202e6c0) at ../../ncurses/tinfo/lib_setup.c:443
 #2  0x0000003b0821cbe0 in doupdate () at ../../ncurses/tty/tty_update.c:726
 #3  0x0000003b08215539 in wrefresh (win=0x2042890) at ../../ncurses/base/lib_refresh.c:65
 #4  0x00000000005257cb in tui_refresh_win (win_info=0xd73d60 <_locator>) at /home/pedro/gdb/mygit/src/gdb/tui/tui-wingeneral.c:60
 #5  0x000000000052265b in tui_show_locator_content () at /home/pedro/gdb/mygit/src/gdb/tui/tui-stack.c:269
 #6  0x0000000000522931 in tui_show_frame_info (fi=0x16b9cc0) at /home/pedro/gdb/mygit/src/gdb/tui/tui-stack.c:364
 #7  0x00000000005278ba in tui_enable () at /home/pedro/gdb/mygit/src/gdb/tui/tui.c:491
 #8  0x0000000000527011 in tui_rl_switch_mode (notused1=1, notused2=1) at /home/pedro/gdb/mygit/src/gdb/tui/tui.c:108

The fix is to resize windows earlier.

gdb/ChangeLog:
2015-02-17  Pedro Alves  <palves@redhat.com>

	* tui/tui.c (tui_enable): Resize windows before anything
	might show a window.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-02-17 13:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-17 11:22 Test results for commit f8e5e23e3dc46042fcf5fad6013e6fa8db13ec43 on branch master sergiodj
2015-02-17 11:33 ` Failures on Fedora-ppc64be-cc-with-index, " sergiodj
2015-02-17 11:56 ` Failures on Fedora-ppc64be-m64, " sergiodj
2015-02-17 12:27 ` Failures on Fedora-ppc64be-native-gdbserver-m64, " sergiodj
2015-02-17 12:27 ` Failures on Debian-x86_64-native-extended-gdbserver-m64, " sergiodj
2015-02-17 12:29 ` Failures on Debian-i686-cc-with-index, " sergiodj
2015-02-17 12:39 ` Failures on Fedora-ppc64be-native-extended-gdbserver-m64, " sergiodj
2015-02-17 12:40 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " sergiodj
2015-02-17 12:55 ` Failures on Fedora-x86_64-native-gdbserver-m32, " sergiodj
2015-02-17 13:17 ` Failures on Debian-i686-native-gdbserver, " sergiodj
2015-02-17 13:24 ` Failures on Debian-x86_64-native-gdbserver-m64, " sergiodj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).