[RFA] Add new command class_experimental

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[RFA] Add new command class_experimental

Michael Snyder
This is to add a new category of gdb commands, "experimental".
These will be explicitly "use at your own risk", and gdb will
tell you so.

This is for new stuff under development, for example the
restore-core-file command, which are meant only for use
by savvy folks who won't be surprised if stuff goes wrong.

They're not really 'maintainance', and they're not really
'obscure', and having a separate class makes it possible
for gdb to explicitly be a nudge about them.

If and when such a command is judged mature and stable,
it will be moved into one of the traditional classes.


2005-11-18  Michael Snyder  <[hidden email]>

        * command.h (enum command_class): Add new class 'experimental'.
        * cli/cli-cmds.c (init_cli_cmds): Initialize class_experimental.
        * cli/cli-decode.c (help_cmd): Add warning flag to help for
        any command of class_experimental.\
        * doc/gdb.texinfo (List of classes of commands): Mention
        experimental command class.

Index: command.h
===================================================================
RCS file: /cvs/src/src/gdb/command.h,v
retrieving revision 1.53
diff -p -r1.53 command.h
*** command.h 26 May 2005 20:48:57 -0000 1.53
--- command.h 18 Nov 2005 20:04:26 -0000
*************** enum command_class
*** 35,41 ****
    no_class = -1, class_run = 0, class_vars, class_stack,
    class_files, class_support, class_info, class_breakpoint, class_trace,
    class_alias, class_obscure, class_user, class_maintenance,
!   class_pseudo, class_tui, class_xdb
  };
 
  /* FIXME: cagney/2002-03-17: Once cmd_type() has been removed, ``enum
--- 35,41 ----
    no_class = -1, class_run = 0, class_vars, class_stack,
    class_files, class_support, class_info, class_breakpoint, class_trace,
    class_alias, class_obscure, class_user, class_maintenance,
!   class_pseudo, class_tui, class_xdb, class_experimental
  };
 
  /* FIXME: cagney/2002-03-17: Once cmd_type() has been removed, ``enum
Index: cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.62
diff -p -r1.62 cli-cmds.c
*** cli/cli-cmds.c 4 Jul 2005 13:29:13 -0000 1.62
--- cli/cli-cmds.c 18 Nov 2005 20:04:29 -0000
*************** Some gdb commands are provided just for
*** 1110,1117 ****
  These commands are subject to frequent change, and may not be as\n\
  well documented as user commands."),
    &cmdlist);
!   add_cmd ("obscure", class_obscure, NULL, _("Obscure features."), &cmdlist);
!   add_cmd ("aliases", class_alias, NULL, _("Aliases of other commands."), &cmdlist);
    add_cmd ("user-defined", class_user, NULL, _("\
  User-defined commands.\n\
  The commands in this class are those defined by the user.\n\
--- 1110,1122 ----
  These commands are subject to frequent change, and may not be as\n\
  well documented as user commands."),
    &cmdlist);
!   add_cmd ("obscure", class_obscure, NULL,
!   _("Obscure features."), &cmdlist);
!   add_cmd ("experimental", class_experimental, NULL,
!   _("Experimental features (no guarantees; use at own risk)."),
!   &cmdlist);
!   add_cmd ("aliases", class_alias, NULL,
!   _("Aliases of other commands."), &cmdlist);
    add_cmd ("user-defined", class_user, NULL, _("\
  User-defined commands.\n\
  The commands in this class are those defined by the user.\n\
Index: cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.55
diff -p -r1.55 cli-decode.c
*** cli/cli-decode.c 26 May 2005 20:49:02 -0000 1.55
--- cli/cli-decode.c 18 Nov 2005 20:04:29 -0000
*************** help_cmd (char *command, struct ui_file
*** 771,779 ****
    fputs_filtered (c->doc, stream);
    fputs_filtered ("\n", stream);
 
    if (c->prefixlist == 0 && c->func != NULL)
      return;
!   fprintf_filtered (stream, "\n");
 
    /* If this is a prefix command, print it's subcommands */
    if (c->prefixlist)
--- 771,785 ----
    fputs_filtered (c->doc, stream);
    fputs_filtered ("\n", stream);
 
+   if (c->func != NULL && c->class == class_experimental)
+     {
+       fputs_filtered ("Experimental!  Use at your own risk!\n",
+      stream);
+     }
+
    if (c->prefixlist == 0 && c->func != NULL)
      return;
!   fputs_filtered ("\n", stream);
 
    /* If this is a prefix command, print it's subcommands */
    if (c->prefixlist)
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.294
diff -p -r1.294 gdb.texinfo
*** doc/gdb.texinfo 18 Nov 2005 19:20:56 -0000 1.294
--- doc/gdb.texinfo 18 Nov 2005 20:20:17 -0000
*************** List of classes of commands:
*** 1545,1550 ****
--- 1545,1551 ----
  aliases -- Aliases of other commands
  breakpoints -- Making program stop at certain points
  data -- Examining data
+ experimental -- Experimental features (no guarantees; use at own risk)
  files -- Specifying and examining files
  internals -- Maintenance commands
  obscure -- Obscure features
Reply | Threaded
Open this post in threaded view
|

Re: [RFA] Add new command class_experimental

Eli Zaretskii
> Date: Fri, 18 Nov 2005 12:25:46 -0800
> From: Michael Snyder <[hidden email]>
>
> This is to add a new category of gdb commands, "experimental".
> These will be explicitly "use at your own risk", and gdb will
> tell you so.

Hmm... I'm not sure I like this idea.  Why not add these as normal
commands?  If it's useful and stable enough, people will use it.  As
for possible bugs, the non-experimental stuff has those too.
Reply | Threaded
Open this post in threaded view
|

Re: [RFA] Add new command class_experimental

Michael Snyder
Eli Zaretskii wrote:

>>Date: Fri, 18 Nov 2005 12:25:46 -0800
>>From: Michael Snyder <[hidden email]>
>>
>>This is to add a new category of gdb commands, "experimental".
>>These will be explicitly "use at your own risk", and gdb will
>>tell you so.
>
>
> Hmm... I'm not sure I like this idea.  Why not add these as normal
> commands?  If it's useful and stable enough, people will use it.  As
> for possible bugs, the non-experimental stuff has those too.

Well, because we *don't* regard it as stable.  Still using
the rcore command as the canonical example, it's highly
experimental, nowhere near "finished", and we can't even
characterize when it will work, and when it won't.  I
would not feel comfortable inviting an unsophisticated
user to use it, and I wouldn't want to take on the task
of explaining to an unsophisticated user the circumstances
under which it might or might not be safe to use.

I think of this as a compromise, to encourage collaborative
development.  Of course I'm willing to just leave the rcore
command out there as a patch, but I figured there could easily
be other features like it, that we might want to "try out"
without implying that they are generally safe, stable, or
"finished".



Reply | Threaded
Open this post in threaded view
|

Re: [RFA] Add new command class_experimental

Eli Zaretskii
> Date: Fri, 18 Nov 2005 13:10:13 -0800
> From: Michael Snyder <[hidden email]>
> CC: [hidden email]
>
> > Hmm... I'm not sure I like this idea.  Why not add these as normal
> > commands?  If it's useful and stable enough, people will use it.  As
> > for possible bugs, the non-experimental stuff has those too.
>
> Well, because we *don't* regard it as stable.

If it is stable enough to go on HEAD (as opposed to a branch, which is
where we try out experimental ideas), it should be good enough to be
treated as a normal command, I think.  That is, if someone reports a
bug that causes it to crash or produce badly incorrect results, we
will work to fix that, right?
Reply | Threaded
Open this post in threaded view
|

Re: [RFA] Add new command class_experimental

Michael Snyder
Eli Zaretskii wrote:

>>Date: Fri, 18 Nov 2005 13:10:13 -0800
>>From: Michael Snyder <[hidden email]>
>>CC: [hidden email]
>>
>>
>>>Hmm... I'm not sure I like this idea.  Why not add these as normal
>>>commands?  If it's useful and stable enough, people will use it.  As
>>>for possible bugs, the non-experimental stuff has those too.
>>
>>Well, because we *don't* regard it as stable.
>
>
> If it is stable enough to go on HEAD (as opposed to a branch, which is
> where we try out experimental ideas), it should be good enough to be
> treated as a normal command, I think.  That is, if someone reports a
> bug that causes it to crash or produce badly incorrect results, we
> will work to fix that, right?

Yeah, but being 'experimental', we would not feel obligated to
support it indefinitely, nor in particular to support its present
user interface, should we decide to change or abandon it.

However, I'll consider it a viable suggestion if you think
we should just use a branch instead.


Reply | Threaded
Open this post in threaded view
|

Re: [RFA] Add new command class_experimental

Eli Zaretskii
> Date: Fri, 18 Nov 2005 14:19:44 -0800
> From: Michael Snyder <[hidden email]>
> CC: [hidden email]
>
> However, I'll consider it a viable suggestion if you think
> we should just use a branch instead.

If you are not sure it's ready for prime time, then I suggest a
branch, yes.