public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Luis Machado <luis.machado@linaro.org>
Cc: Aleksey Midenkov <midenok@gmail.com>,  gdb@sourceware.org
Subject: Re: TUI single key mode: how to customize a key?
Date: Fri, 25 Oct 2019 14:19:00 -0000	[thread overview]
Message-ID: <87h83wq55k.fsf@tromey.com> (raw)
In-Reply-To: <34dcef86-e8fb-ee08-1f57-f9ecb00d6d4e@linaro.org> (Luis Machado's	message of "Fri, 18 Oct 2019 10:12:34 -0300")

>>>>> "Luis" == Luis Machado <luis.machado@linaro.org> writes:

Luis> No. Unfortunately the keys are hardcoded in gdb/tui/tui.c:

Luis> static const struct tui_char_command tui_commands[] = {
Luis>   { 'c', "continue" },
Luis>   { 'd', "down" },
Luis>   { 'f', "finish" },
Luis>   { 'n', "next" },
Luis>   { 'o', "nexti" },
Luis>   { 'r', "run" },
Luis>   { 's', "step" },
Luis>   { 'i', "stepi" },
Luis>   { 'u', "up" },
Luis>   { 'v', "info locals" },
Luis>   { 'w', "where" },
Luis>   { 0, 0 },
Luis> };

Luis> I don't see a problem with making those configurable. Feel free to
Luis> send a patch for it or a design idea so we can make this work.

Actually, I implemented this a short time ago.
You have to use a gdb that is built against Readline 8.0.
See:

commit 11061048d1fed4465b0e62eb3c14dabf0beab59b
Author: Tom Tromey <tom@tromey.com>
Date:   Tue Sep 10 17:25:35 2019 -0600

    Give a name to the TUI SingleKey keymap
    
    Readline 8.0 has a feature that lets an application name a keymap.
    This in turn makes it simpler for users to bind keys in keymaps in
    their .inputrc.
    
    This patch gives a name to the TUI SingleKey keymap, so that
    additional bindings can be made there.  For example:
    
        $if gdb
        set keymap SingleKey
        "X": "echo hello\\n\n"
        $endif

Tom

  reply	other threads:[~2019-10-25 14:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14 18:01 Aleksey Midenkov
2019-10-18 13:12 ` Luis Machado
2019-10-25 14:19   ` Tom Tromey [this message]
2019-10-25 14:40     ` Luis Machado

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=87h83wq55k.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb@sourceware.org \
    --cc=luis.machado@linaro.org \
    --cc=midenok@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).