specifying gdb's exit code

Message ID 87lhuw9br6.fsf@fleche.redhat.com
State Superseded
Headers

Commit Message

Tom Tromey April 23, 2014, 5:49 p.m. UTC
  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
  

Comments

Pedro Alves April 23, 2014, 5:57 p.m. UTC | #1
On 04/23/2014 06:49 PM, Tom Tromey wrote:

> 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."));

I think this should be "GDB" in caps.  "apropos gdb" seems to
indicate that's how we spell it in the online help.

Otherwise looks fine to me.

Thanks,
  
Paul_Koning@Dell.com April 23, 2014, 6:17 p.m. UTC | #2
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
  
Tom Tromey April 23, 2014, 6:22 p.m. UTC | #3
>>>>> "Paul" ==   <Paul_Koning@Dell.com> writes:

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

Yeah, see top.c:quit_force.

Tom
  
Daniel Gutson April 23, 2014, 8:53 p.m. UTC | #4
On Wed, Apr 23, 2014 at 3:22 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Paul" ==   <Paul_Koning@Dell.com> writes:
>
> Paul> Is the default actually zero?  The help that Pedro quoted says that
> Paul> the default is successful exit.  On Unix, that’s zero, but on VMS,
> Paul> it’s one.
>
> Yeah, see top.c:quit_force.

Thanks for the review, should I update the patch
or you will update and commit it for me?

>
> Tom
  
Daniel Gutson April 23, 2014, 8:55 p.m. UTC | #5
On Wed, Apr 23, 2014 at 5:53 PM, Daniel Gutson
<daniel.gutson@tallertechnologies.com> wrote:
> On Wed, Apr 23, 2014 at 3:22 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>>> "Paul" ==   <Paul_Koning@Dell.com> writes:
>>
>> Paul> Is the default actually zero?  The help that Pedro quoted says that
>> Paul> the default is successful exit.  On Unix, that’s zero, but on VMS,
>> Paul> it’s one.
>>
>> Yeah, see top.c:quit_force.
>
> Thanks for the review, should I update the patch
> or you will update and commit it for me?

(please note that I don't have write access)

>
>>
>> Tom
>
>
>
> --
>
> Daniel F. Gutson
> Chief Engineering Officer, SPD
>
>
> San Lorenzo 47, 3rd Floor, Office 5
>
> Córdoba, Argentina
>
>
> Phone: +54 351 4217888 / +54 351 4218211
>
> Skype: dgutson
  

Patch

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);