This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: specifying gdb's exit code


On Apr 23, 2014, at 1:49 PM, Tom Tromey <tromey@redhat.com> wrote:

> Pedro> Would it be good if the online help and the manual agreed a bit
> Pedro> more?  The manual says "quit [expression]":
> 
> Yeah, I forgot it can be an expression.
> 
> What do you think of this?
> 
> Tom
> 
> diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
> index bfcd975..0eff952 100644
> --- a/gdb/cli/cli-cmds.c
> +++ b/gdb/cli/cli-cmds.c
> @@ -1685,7 +1685,11 @@ strict == evaluate script according to filename extension, error if not supporte
> 			show_script_ext_mode,
> 			&setlist, &showlist);
> 
> -  add_com ("quit", class_support, quit_command, _("Exit gdb."));
> +  add_com ("quit", class_support, quit_command, _("\
> +Exit gdb.\n\
> +Usage: quit [EXPR]\n\
> +The optional expression EXPR, if present, is evaluated and the result\n\
> +used as gdb's exit code.  The default is zero."));
>   c = add_com ("help", class_support, help_command,
> 	       _("Print list of commands."));
>   set_cmd_completer (c, command_completer);

Is the default actually zero?  The help that Pedro quoted says that the default is successful exit.  On Unix, that’s zero, but on VMS, it’s one.

	paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]