gdb: add "exit" command as an alias for "quit"

This command adds the "exit" command as an alias for the "quit"
command, as requested in PR gdb/28406.

The documentation is also updated to mention this new command.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28406
This commit is contained in:
Enze Li 2021-12-18 15:19:12 +04:00 committed by Joel Brobecker
parent 8d34471f70
commit fa8f0a0ff0
3 changed files with 15 additions and 7 deletions

View file

@ -2445,7 +2445,7 @@ strict == evaluate script according to filename extension, error if not supporte
cmd_list_element *quit_cmd
= add_com ("quit", class_support, quit_command, _("\
Exit gdb.\n\
Usage: quit [EXPR]\n\
Usage: quit [EXPR] or exit [EXPR]\n\
The optional expression EXPR, if present, is evaluated and the result\n\
used as GDB's exit code. The default is zero."));
cmd_list_element *help_cmd
@ -2453,6 +2453,7 @@ used as GDB's exit code. The default is zero."));
_("Print list of commands."));
set_cmd_completer (help_cmd, command_completer);
add_com_alias ("q", quit_cmd, class_support, 1);
add_com_alias ("exit", quit_cmd, class_support, 1);
add_com_alias ("h", help_cmd, class_support, 1);
add_setshow_boolean_cmd ("verbose", class_support, &info_verbose, _("\