This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: specifying gdb's exit code
- From: <Paul_Koning at Dell dot com>
- To: <alves dot ped at gmail dot com>
- Cc: <tromey at redhat dot com>, <daniel dot gutson at tallertechnologies dot com>, <gdb-patches at sourceware dot org>
- Date: Wed, 23 Apr 2014 17:35:58 +0000
- Subject: Re: specifying gdb's exit code
- Authentication-results: sourceware.org; auth=none
- References: <CAF5HaEVTZAxc0FNR9GnGNKJqxGSrbQaTfZ7ZRMoueTg6jQyL8A at mail dot gmail dot com> <CAF5HaEWDv6Gb2m-iDpzcM4y_ybkT46R1b96xxdS9buLHbsgwRQ at mail dot gmail dot com> <CADPb22RS0J3X8hcBiUiDPp62RYiKPE4vCSPV5WEMUF01KzsiLg at mail dot gmail dot com> <CAF5HaEV3wMHXfk3jLmbY-E6XAaZSmBRhzDjo2BvhQ7NbvvCtZQ at mail dot gmail dot com> <CAF5HaEX1jfUdDkH3FrNviGYezWog5oyVF3WYM6mwmP=EtrvCjQ at mail dot gmail dot com> <87ppk89dir dot fsf at fleche dot redhat dot com> <5357F862 dot 306 at gmail dot com>
On Apr 23, 2014, at 1:29 PM, Pedro Alves <alves.ped@gmail.com> wrote:
> On 04/23/2014 06:11 PM, Tom Tromey wrote:
>> - add_com ("quit", class_support, quit_command, _("Exit gdb."));
>> + add_com ("quit", class_support, quit_command, _("\
>> +Exit gdb.\n\
>> +Usage: quit [CODE]\n\
>> +The optional argument CODE, if present, is used as gdb's exit status.\n\
>> +The default is zero."));
>> c = add_com ("help", class_support, help_command,
>> _("Print list of commands."));
>> set_cmd_completer (c, command_completer);
>
> Would it be good if the online help and the manual agreed a bit
> more? The manual says "quit [expression]":
>
> @node Quitting GDB
> @section Quitting @value{GDBN}
> @cindex exiting @value{GDBN}
> @cindex leaving @value{GDBN}
>
> @table @code
> @kindex quit @r{[}@var{expression}@r{]}
> @kindex q @r{(@code{quit})}
> @item quit @r{[}@var{expression}@r{]}
> @itemx q
> To exit @value{GDBN}, use the @code{quit} command (abbreviated
> @code{q}), or type an end-of-file character (usually @kbd{Ctrl-d}). If you
> do not supply @var{expression}, @value{GDBN} will terminate normally;
> otherwise it will terminate using the result of @var{expression} as the
> error code.
> @end table
I think it should say “exit code” rather than “error code”. Whether a given expression value is the code for an error depends on the value and on the host OS.
paul