[v2,gdb/tui] add SingleKey bindings for reverse execution commands

Message ID 20231208162754.867497-1-mhov@undo.io
State New
Headers
Series [v2,gdb/tui] add SingleKey bindings for reverse execution commands |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 fail Testing failed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed

Commit Message

Magne Hov Dec. 8, 2023, 4:27 p.m. UTC
  The bindings for the reverse execution commands are the same letters
as the forward execution command, but with the opposite case. This way
one can simply hold down the Shift modifier key or tap the Caps Lock key
to change the direction of execution.
---
 gdb/doc/gdb.texinfo | 24 ++++++++++++++++++++++++
 gdb/tui/tui.c       |  6 ++++++
 2 files changed, 30 insertions(+)
  

Comments

Eli Zaretskii Dec. 8, 2023, 7:23 p.m. UTC | #1
> From: Magne Hov <mhov@undo.io>
> Cc: Magne Hov <mhov@undo.io>
> Date: Fri,  8 Dec 2023 16:27:54 +0000
> 
> The bindings for the reverse execution commands are the same letters
> as the forward execution command, but with the opposite case. This way
> one can simply hold down the Shift modifier key or tap the Caps Lock key
> to change the direction of execution.
> ---
>  gdb/doc/gdb.texinfo | 24 ++++++++++++++++++++++++
>  gdb/tui/tui.c       |  6 ++++++
>  2 files changed, 30 insertions(+)

Thanks, the documentation part is OK.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
  
Tom Tromey Dec. 11, 2023, 3:11 p.m. UTC | #2
>>>>> "Magne" == Magne Hov <mhov@undo.io> writes:

Magne> The bindings for the reverse execution commands are the same letters
Magne> as the forward execution command, but with the opposite case. This way
Magne> one can simply hold down the Shift modifier key or tap the Caps Lock key
Magne> to change the direction of execution.

Thanks.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  
Magne Hov Dec. 12, 2023, 2:59 p.m. UTC | #3
Thank you.

Would you want any other maintainers to approve before I check this in?

On Mon, Dec 11 2023, Tom Tromey wrote:

>>>>>> "Magne" == Magne Hov <mhov@undo.io> writes:
>
> Magne> The bindings for the reverse execution commands are the same letters
> Magne> as the forward execution command, but with the opposite case. This way
> Magne> one can simply hold down the Shift modifier key or tap the Caps Lock key
> Magne> to change the direction of execution.
>
> Thanks.
> Approved-By: Tom Tromey <tom@tromey.com>
>
> Tom
  
Tom Tromey Dec. 12, 2023, 6:15 p.m. UTC | #4
>>>>> "Magne" == Magne Hov <mhov@undo.io> writes:

Magne> Thank you.
Magne> Would you want any other maintainers to approve before I check this in?

I think it's fine to just go ahead.
Worst case, if someone does not like it, we can always pull it if we
really need to.

Tom
  
Magne Hov Dec. 13, 2023, 12:06 p.m. UTC | #5
On Tue, Dec 12 2023, Tom Tromey wrote:

>>>>>> "Magne" == Magne Hov <mhov@undo.io> writes:
>
> Magne> Thank you.
> Magne> Would you want any other maintainers to approve before I check this in?
>
> I think it's fine to just go ahead.
> Worst case, if someone does not like it, we can always pull it if we
> really need to.

Thank you. This is pushed now.

>
> Tom
  

Patch

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index d2428efdb63..c42ccfdcb6d 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -30431,6 +30431,10 @@  switch into this mode, where the following key bindings are used:
 @item c
 continue
 
+@kindex C @r{(SingleKey TUI key)}
+@item C
+reverse-continue
+
 @kindex d @r{(SingleKey TUI key)}
 @item d
 down
@@ -30439,14 +30443,26 @@  down
 @item f
 finish
 
+@kindex F @r{(SingleKey TUI key)}
+@item F
+reverse-finish
+
 @kindex n @r{(SingleKey TUI key)}
 @item n
 next
 
+@kindex N @r{(SingleKey TUI key)}
+@item N
+reverse-next
+
 @kindex o @r{(SingleKey TUI key)}
 @item o
 nexti.  The shortcut letter @samp{o} stands for ``step Over''.
 
+@kindex O @r{(SingleKey TUI key)}
+@item O
+reverse-nexti
+
 @kindex q @r{(SingleKey TUI key)}
 @item q
 exit the SingleKey mode.
@@ -30459,10 +30475,18 @@  run
 @item s
 step
 
+@kindex S @r{(SingleKey TUI key)}
+@item S
+reverse-step
+
 @kindex i @r{(SingleKey TUI key)}
 @item i
 stepi.  The shortcut letter @samp{i} stands for ``step Into''.
 
+@kindex I @r{(SingleKey TUI key)}
+@item I
+reverse-stepi
+
 @kindex u @r{(SingleKey TUI key)}
 @item u
 up
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 941c65c970f..6d6a03251e7 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -85,13 +85,19 @@  struct tui_char_command
    mode.  */
 static const struct tui_char_command tui_commands[] = {
   { 'c', "continue" },
+  { 'C', "reverse-continue" },
   { 'd', "down" },
   { 'f', "finish" },
+  { 'F', "reverse-finish" },
   { 'n', "next" },
+  { 'N', "reverse-next" },
   { 'o', "nexti" },
+  { 'O', "reverse-nexti" },
   { 'r', "run" },
   { 's', "step" },
+  { 'S', "reverse-step" },
   { 'i', "stepi" },
+  { 'I', "reverse-stepi" },
   { 'u', "up" },
   { 'v', "info locals" },
   { 'w', "where" },