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

Message ID 20231208133836.835625-1-mhov@undo.io
State New
Headers
Series [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 success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed

Commit Message

Magne Hov Dec. 8, 2023, 1:38 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/tui/tui.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Tom Tromey Dec. 8, 2023, 3:11 p.m. UTC | #1
>>>>> "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.

IMO it's fine to do this, but this patch needs an accompanying change to
the manual.  See the "TUI Single Key Mode" node.

thanks,
Tom
  

Patch

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" },