From: Pedro Alves <pedro_alves@portugalmail.pt>
To: Jan Holesovsky <kendy@suse.cz>
Cc: gdb-patches@sourceware.org
Subject: Re: Patches to improve the gdbtui user experience
Date: Sat, 15 Sep 2007 17:01:00 -0000 [thread overview]
Message-ID: <46EC0FC8.3020704@portugalmail.pt> (raw)
In-Reply-To: <200709141358.24710.kendy@suse.cz>
[-- Attachment #1: Type: text/plain, Size: 2269 bytes --]
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 <kendy@suse.cz>
>
> * 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 <return>... 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
[-- Attachment #2: fix-prompt.diff --]
[-- Type: text/x-diff, Size: 2127 bytes --]
* 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;
}
next prev parent reply other threads:[~2007-09-15 17:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-14 11:57 Jan Holesovsky
2007-09-14 14:25 ` Daniel Jacobowitz
2007-09-15 17:01 ` Pedro Alves [this message]
2007-09-15 21:08 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46EC0FC8.3020704@portugalmail.pt \
--to=pedro_alves@portugalmail.pt \
--cc=gdb-patches@sourceware.org \
--cc=kendy@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox