From e98d2e6da4512157ab749734dc872aa41830d7c8 Mon Sep 17 00:00:00 2001 From: Philippe Waroquiers Date: Sat, 23 May 2020 15:11:52 +0200 Subject: [PATCH] Ensure class_tui is listed in the output of "help" giving the list of classes. Before this change, "help" was not showing the TUI class. With this change: (gdb) help ... support -- Support facilities. text-user-interface -- TUI is the GDB text based interface. tracepoints -- Tracing of program execution without stopping the program. ... (gdb) help text-user-interface TUI is the GDB text based interface. In TUI mode, GDB can display several text windows showing the source file, the processor registers, the program disassembly, ... List of commands: + -- Scroll window forward. ... Note that we cannot use "tui" for the fake class command name, as "tui" is a command. gdb/ChangeLog 2020-05-26 Philippe Waroquiers * command.h: Add comment giving the name of class_tui. * cli/cli-cmds.c (_initialize_cli_cmds): If TUI defined, create the fake command for the help for class_tui. --- gdb/ChangeLog | 6 ++++++ gdb/cli/cli-cmds.c | 6 ++++++ gdb/command.h | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9e792fee1eb..b0ec14fd4f9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2020-05-26 Philippe Waroquiers + + * command.h: Add comment giving the name of class_tui. + * cli/cli-cmds.c (_initialize_cli_cmds): If TUI defined, + create the fake command for the help for class_tui. + 2020-05-26 Tom Tromey * ada-lang.c (ada_print_array_index): Change type. Call val_atr. diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index eb6e32b0469..fdc8758bcd0 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -2150,6 +2150,12 @@ Variable lookups are done with respect to the selected frame.\n\ When the program being debugged stops, gdb selects the innermost frame.\n\ The commands below can be used to select other frames by number or address."), &cmdlist); +#ifdef TUI + add_cmd ("text-user-interface", class_tui, + _("TUI is the GDB text based interface.\n\ +In TUI mode, GDB can display several text windows showing\n\ +the source file, the processor registers, the program disassembly, ..."), &cmdlist); +#endif add_cmd ("running", class_run, _("Running the program."), &cmdlist); /* Define general commands. */ diff --git a/gdb/command.h b/gdb/command.h index 04a380cba4a..32b5b35b0c5 100644 --- a/gdb/command.h +++ b/gdb/command.h @@ -64,7 +64,7 @@ enum command_class class_bookmark, class_obscure, /* obscure */ class_maintenance, /* internals */ - class_tui, + class_tui, /* text-user-interface */ class_user, /* user-defined */ /* Used for "show" commands that have no corresponding "set" command. */ -- 2.30.2