From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5060 invoked by alias); 15 Sep 2007 17:01:27 -0000 Received: (qmail 5039 invoked by uid 22791); 15 Sep 2007 17:01:26 -0000 X-Spam-Check-By: sourceware.org Received: from ug-out-1314.google.com (HELO ug-out-1314.google.com) (66.249.92.169) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 15 Sep 2007 17:01:11 +0000 Received: by ug-out-1314.google.com with SMTP id o2so671042uge for ; Sat, 15 Sep 2007 10:01:08 -0700 (PDT) Received: by 10.67.16.5 with SMTP id t5mr5015208ugi.1189875668183; Sat, 15 Sep 2007 10:01:08 -0700 (PDT) Received: from ?88.210.69.58? ( [88.210.69.58]) by mx.google.com with ESMTPS id 32sm1652550nfu.2007.09.15.10.01.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 15 Sep 2007 10:01:07 -0700 (PDT) Message-ID: <46EC0FC8.3020704@portugalmail.pt> Date: Sat, 15 Sep 2007 17:01:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: Jan Holesovsky CC: gdb-patches@sourceware.org Subject: Re: Patches to improve the gdbtui user experience References: <200709141358.24710.kendy@suse.cz> In-Reply-To: <200709141358.24710.kendy@suse.cz> Content-Type: multipart/mixed; boundary="------------010801080609060701080204" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-09/txt/msg00195.txt.bz2 This is a multi-part message in MIME format. --------------010801080609060701080204 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 2269 Jan Holesovsky wrote: > > I've already sent these patches once, but got no response - could you please > have a look, and apply if OK? They are more or less trivial, but especially > the single-key-history.diff and fix-prompt.diff improve the user experience > of single key mode a lot. Comments appreciated ;-) > I use tui mode often, but single key mode, not so often. Anyway, see my comments below, but note that I can't approve patches. > ChangeLog for the changes: > > 2007-05-21 Jan Holesovsky > > * tui/tui.c: SingleKey binding for stepi and nexti; This seems useful indeed. Thanks! > don't quit > SingleKey by 'q' when it's activated by a nontrivial ctrl+x > combination - the user is smart enough to exit this mode. If the only command gdb knows starting with 'q' is "quit", what is the use? What is it preventing you to type? Maybe a target/host specific command? At least on cygwin 'q' is not ambiguous. On the other hand, if you're in in single key mode, and want to type "quit", you have to type "qquit", since the first 'q' is eaten, else you'll end up typing "uit" :) I guess it's a matter of personal taste either way. > * tui/tui-win.c: Fix silly typos in help. This is trivial indeed. > * tui/tui-io.c: Display prompts like ---Type ... even in > SingleKey mode, and be able to react there. Seems like a hack to me. What about not setting TUI_SINGLE_KEY_MODE in the first place, if gdb is in the middle of a possibly length command? The attached works for me, but I didn't regtest it. Is this usage of immediate_quit ok? > * tui/tui-command.c: When switched temporarily from the SingleKey mode > to command mode, bind [Up] and [Down] keys to readline history; it's > safe because we know that the user wants to type. In single key mode, I can start to type 'b' for a breakpoint, and then decide I want to scroll to see at which line I would want to place the breakpoint at using up/down. If I want access to the history, I can either use c-p/c-n, or use c-x o to switch focus to the command line, and then use up/down. With your patch, if I already started typing 'b', I'll have no way to scroll, other than deleting what I've already typed, will I? Cheers, Pedro Alves --------------010801080609060701080204 Content-Type: text/x-diff; name="fix-prompt.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fix-prompt.diff" Content-length: 2127 * tui/tui.c (tui_rl_command_mode): Update comment. (tui_rl_startup_hook): Don't change to single key mode, if immediate_quit is set. * tui/tui-io.c (tui_redisplay_readline): Likewise. --- gdb/tui/tui-io.c | 8 ++++++-- gdb/tui/tui.c | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) Index: src/gdb/tui/tui-io.c =================================================================== --- src.orig/gdb/tui/tui-io.c 2007-09-03 22:27:56.000000000 +0100 +++ src/gdb/tui/tui-io.c 2007-09-15 17:35:18.000000000 +0100 @@ -209,9 +209,13 @@ tui_redisplay_readline (void) /* Detect when we temporarily left SingleKey and now the readline edit buffer is empty, automatically restore the SingleKey - mode. */ + mode, unless gdb is in the middle of executing a command, + possibly expecting user interaction. */ if (tui_current_key_mode == TUI_ONE_COMMAND_MODE && rl_end == 0) - tui_set_key_mode (TUI_SINGLE_KEY_MODE); + { + if (!immediate_quit) + tui_set_key_mode (TUI_SINGLE_KEY_MODE); + } if (tui_current_key_mode == TUI_SINGLE_KEY_MODE) prompt = ""; Index: src/gdb/tui/tui.c =================================================================== --- src.orig/gdb/tui/tui.c 2007-09-03 22:27:58.000000000 +0100 +++ src/gdb/tui/tui.c 2007-09-15 17:33:46.000000000 +0100 @@ -255,7 +255,9 @@ tui_rl_command_key (int count, int key) /* TUI readline command. Temporarily leave the TUI SingleKey mode to allow editing a gdb command with the normal readline. Once the command - is executed, the TUI SingleKey mode is installed back. */ + is executed, the TUI SingleKey mode is installed back, + unless gdb is in the middle of executing a command, possibly + expecting user interaction. */ static int tui_rl_command_mode (int count, int key) { @@ -285,7 +287,10 @@ tui_rl_startup_hook (void) { rl_already_prompted = 1; if (tui_current_key_mode != TUI_COMMAND_MODE) - tui_set_key_mode (TUI_SINGLE_KEY_MODE); + { + if (!immediate_quit) + tui_set_key_mode (TUI_SINGLE_KEY_MODE); + } tui_redisplay_readline (); return 0; } --------------010801080609060701080204--