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]

[RFA] Add new command class_experimental


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  <msnyder@redhat.com>

	* 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

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