Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Ofir Cohen <ofircohenn@gmail.com>
To: Aleksey Midenkov <midenok@gmail.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Modifying keymap for TUI mode
Date: Sat, 31 Jan 2015 20:15:00 -0000	[thread overview]
Message-ID: <CAHOBVAdYEnRWStu2vNfHA=wOaZ+4mU0TH62ktdmwrnF_rZqpfg@mail.gmail.com> (raw)
In-Reply-To: <CAF8BazB2+_5AFj4AcZwkb_rGYzN8CrfUD78v7JxvhFrLLawYAQ@mail.gmail.com>

It's possible, but for some of the key combinations you might need to
unset the focus of the TUI window first
(e.g. arrow keys have different meaning, when source window is in
focus, up arrow navigates
one line in source code upwards, while up means history lookup when
the CLI gdb prompt is in focus).

In order to unset the focus, do: Ctrl+x, o.
For more information on key combinations in TUI mode, follow
https://sourceware.org/gdb/onlinedocs/gdb/TUI-Keys.html

In order to introduce new key bindings, you have two options:
1) Add them to ~/.initrc, for readline to digest (when gdb is loaded,
regardless of TUI/non-TUI mode)
2) Modify via source (readline/readline.c IIRC), just look around in the code
    you'll find the calls to readline functions to bind keys.
    This option is less preferable, but it works too.

If after adding the new key bindings and starting gdb nothing happens,
try to toggle between TUI and non-TUI mode via: Ctrl+x, a
Also, you could launch gdb once with '--tui', and once w/o, and determine
whether it's TUI related or not.

Regards,
Ofir Cohen

On 30 January 2015 at 12:11, Aleksey Midenkov <midenok@gmail.com> wrote:
> Is it possible to modify keymap for TUI mode? I want to assign key
> bindings for commands 'si' and 'ni' (step one instruction).


  reply	other threads:[~2015-01-30 18:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30 18:39 Aleksey Midenkov
2015-01-31 20:15 ` Ofir Cohen [this message]
     [not found] ` <CAHOBVAdVg2k4k6Q5UnwLT79zKa3P7xvOQEEQit5qtWM9RbtOZA@mail.gmail.com>
2015-02-02 12:41   ` Aleksey Midenkov
2015-02-02 12:45     ` Ofir Cohen
2015-02-02 12:55       ` Aleksey Midenkov

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='CAHOBVAdYEnRWStu2vNfHA=wOaZ+4mU0TH62ktdmwrnF_rZqpfg@mail.gmail.com' \
    --to=ofircohenn@gmail.com \
    --cc=gdb@sourceware.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