any issue with adding new command (alias) "exit"? Re: [PING] [PATCH 1/2] gdb: improve quit command with an alias called exit

Tom de Vries tdevries@suse.de
Sat Nov 27 20:40:01 GMT 2021


On 11/27/21 8:02 AM, Joel Brobecker via Gdb-patches wrote:
> Does anyone see an issue with adding the "exit" alias command
> as suggested by the PR & patch below?
> 
> 

When I'm in a shell I don't know very well, and I want to exit, I try
quit, exit, ^C, ^D hoping to get the right command.

So, the exit alias for quit makes sense to me.

Thanks,
- Tom

> On Tue, Nov 23, 2021 at 10:21:13PM +0800, Enze Li via Gdb-patches wrote:
>> PING*1
>>
>> Thanks,
>> Enze
>>
>> On Sat, 2021-11-13 at 20:08 +0800, Enze Li via Gdb-patches wrote:
>>> This commit implements a request to add a quit command alias in
>>> PR28406[1]. With this commit, we can now use the "exit" alias
>>> to exit the GDB.
>>>
>>> Tested on x86_64-linux.
>>>
>>> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=28406
>>> ---
>>>  gdb/cli/cli-cmds.c | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
>>> index 2cf614c8e7e..832c9e56937 100644
>>> --- a/gdb/cli/cli-cmds.c
>>> +++ b/gdb/cli/cli-cmds.c
>>> @@ -2377,7 +2377,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
>>> @@ -2385,6 +2385,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,
>>> _("\
>>
> 


More information about the Gdb-patches mailing list