public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Modifying keymap for TUI mode
@ 2015-01-30 18:39 Aleksey Midenkov
  2015-01-31 20:15 ` Ofir Cohen
       [not found] ` <CAHOBVAdVg2k4k6Q5UnwLT79zKa3P7xvOQEEQit5qtWM9RbtOZA@mail.gmail.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Aleksey Midenkov @ 2015-01-30 18:39 UTC (permalink / raw)
  To: gdb

Is it possible to modify keymap for TUI mode? I want to assign key
bindings for commands 'si' and 'ni' (step one instruction).

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

* Re: Modifying keymap for TUI mode
  2015-01-30 18:39 Modifying keymap for TUI mode Aleksey Midenkov
@ 2015-01-31 20:15 ` Ofir Cohen
       [not found] ` <CAHOBVAdVg2k4k6Q5UnwLT79zKa3P7xvOQEEQit5qtWM9RbtOZA@mail.gmail.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Ofir Cohen @ 2015-01-31 20:15 UTC (permalink / raw)
  To: Aleksey Midenkov; +Cc: gdb

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).

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

* Re: Modifying keymap for TUI mode
       [not found] ` <CAHOBVAdVg2k4k6Q5UnwLT79zKa3P7xvOQEEQit5qtWM9RbtOZA@mail.gmail.com>
@ 2015-02-02 12:41   ` Aleksey Midenkov
  2015-02-02 12:45     ` Ofir Cohen
  0 siblings, 1 reply; 5+ messages in thread
From: Aleksey Midenkov @ 2015-02-02 12:41 UTC (permalink / raw)
  To: Ofir Cohen; +Cc: gdb

.initrc or .inputrc? If I add them to global .inputrc how I specify
their application to TUI single-key mode?

On Fri, Jan 30, 2015 at 9:37 PM, Ofir Cohen <ofircohenn@gmail.com> wrote:
> 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).
>
>

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

* Re: Modifying keymap for TUI mode
  2015-02-02 12:41   ` Aleksey Midenkov
@ 2015-02-02 12:45     ` Ofir Cohen
  2015-02-02 12:55       ` Aleksey Midenkov
  0 siblings, 1 reply; 5+ messages in thread
From: Ofir Cohen @ 2015-02-02 12:45 UTC (permalink / raw)
  To: Aleksey Midenkov; +Cc: gdb

> initrc or .inputrc?
.inputrc, my bad.

> how I specify their application to TUI single-key mode?
You don't, I don't think there's a way to separate these and they
should appear for both.
AFAIK if you really want to set TUI specific keys you'll probably need
to hack the TUI sources.

Regards,
Ofir

On 2 February 2015 at 14:40, Aleksey Midenkov <midenok@gmail.com> wrote:
> .initrc or .inputrc? If I add them to global .inputrc how I specify
> their application to TUI single-key mode?
>
> On Fri, Jan 30, 2015 at 9:37 PM, Ofir Cohen <ofircohenn@gmail.com> wrote:
>> 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).
>>
>>

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

* Re: Modifying keymap for TUI mode
  2015-02-02 12:45     ` Ofir Cohen
@ 2015-02-02 12:55       ` Aleksey Midenkov
  0 siblings, 0 replies; 5+ messages in thread
From: Aleksey Midenkov @ 2015-02-02 12:55 UTC (permalink / raw)
  To: Ofir Cohen; +Cc: gdb

On Mon, Feb 2, 2015 at 3:45 PM, Ofir Cohen <ofircohenn@gmail.com> wrote:
>> initrc or .inputrc?
> .inputrc, my bad.
>
>> how I specify their application to TUI single-key mode?
> You don't, I don't think there's a way to separate these and they
> should appear for both.
> AFAIK if you really want to set TUI specific keys you'll probably need
> to hack the TUI sources.

AFAIK, GDB loads specific map for TUI single-key mode. As far as
documentation says so. My question was -- is it possible to overload
this map? At least it is evident that such possibility is expected.
There is no need to mention the alternative of modifying source code.

>
> Regards,
> Ofir
>
> On 2 February 2015 at 14:40, Aleksey Midenkov <midenok@gmail.com> wrote:
>> .initrc or .inputrc? If I add them to global .inputrc how I specify
>> their application to TUI single-key mode?
>>
>> On Fri, Jan 30, 2015 at 9:37 PM, Ofir Cohen <ofircohenn@gmail.com> wrote:
>>> 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).
>>>
>>>

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

end of thread, other threads:[~2015-02-02 12:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-30 18:39 Modifying keymap for TUI mode Aleksey Midenkov
2015-01-31 20:15 ` Ofir Cohen
     [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

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).