This is the mail archive of the gdb-patches@sources.redhat.com 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]

[commit] New function add_setshow_integer_cmd; use


Another one,
Andrew
2005-02-18  Andrew Cagney  <cagney@gnu.org>

	* cli/cli-decode.c (add_setshow_integer_cmd): New function.
	* command.h (add_setshow_integer_cmd): Declare.
	* cli/cli-cmds.c: Update.
	
Index: command.h
===================================================================
RCS file: /cvs/src/src/gdb/command.h,v
retrieving revision 1.48
diff -p -u -r1.48 command.h
--- command.h	17 Feb 2005 15:00:31 -0000	1.48
+++ command.h	18 Feb 2005 20:53:28 -0000
@@ -301,6 +301,17 @@ extern void add_setshow_string_noescape_
 					     struct cmd_list_element **set_list,
 					     struct cmd_list_element **show_list);
 
+extern void add_setshow_integer_cmd (char *name,
+				     enum command_class class,
+				     unsigned int *var,
+				     const char *set_doc,
+				     const char *show_doc,
+				     const char *help_doc,
+				     cmd_sfunc_ftype *set_func,
+				     show_value_ftype *show_func,
+				     struct cmd_list_element **set_list,
+				     struct cmd_list_element **show_list);
+
 extern void add_setshow_uinteger_cmd (char *name,
 				      enum command_class class,
 				      unsigned int *var,
Index: cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.55
diff -p -u -r1.55 cli-cmds.c
--- cli/cli-cmds.c	18 Feb 2005 18:58:56 -0000	1.55
+++ cli/cli-cmds.c	18 Feb 2005 20:53:29 -0000
@@ -1199,12 +1199,14 @@ is displayed."),
 			    NULL, /* FIXME: i18n: */
 			    &setdebuglist, &showdebuglist);
 
-  deprecated_add_show_from_set
-    (add_set_cmd ("remotetimeout", no_class, var_integer, (char *) &remote_timeout,
-		  "Set timeout limit to wait for target to respond.\n\
+  add_setshow_integer_cmd ("remotetimeout", no_class, &remote_timeout, _("\
+Set timeout limit to wait for target to respond."), _("\
+Show timeout limit to wait for target to respond."), _("\
 This value is used to set the time limit for gdb to wait for a response\n\
-from the target.", &setlist),
-     &showlist);
+from the target."),
+			   NULL,
+			   NULL, /* FIXME: i18n: */
+			   &setlist, &showlist);
 
   add_prefix_cmd ("debug", no_class, set_debug,
 		  _("Generic command for setting gdb debugging flags"),
@@ -1281,10 +1283,11 @@ With no argument, show definitions of al
   add_com ("apropos", class_support, apropos_command,
 	   _("Search for commands matching a REGEXP"));
 
-  deprecated_add_show_from_set
-    (add_set_cmd ("max-user-call-depth", no_class, var_integer, 
-		  (char *) &max_user_call_depth,
-		  "Set the max call depth for user-defined commands.\n", 
-		  &setlist),
-     &showlist);
+  add_setshow_integer_cmd ("max-user-call-depth", no_class,
+			   &max_user_call_depth, _("\
+Set the max call depth for user-defined commands."), _("\
+Show the max call depth for user-defined commands."), NULL,
+			   NULL,
+			   NULL, /* FIXME: i18n: */
+			   &setlist, &showlist);
 }
Index: cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.50
diff -p -u -r1.50 cli-decode.c
--- cli/cli-decode.c	17 Feb 2005 17:11:04 -0000	1.50
+++ cli/cli-decode.c	18 Feb 2005 20:53:29 -0000
@@ -540,6 +540,27 @@ add_setshow_string_noescape_cmd (char *n
    add_cmd.  VAR is address of the variable which will contain the
    value.  SET_DOC and SHOW_DOC are the documentation strings.  */
 void
+add_setshow_integer_cmd (char *name, enum command_class class,
+			  unsigned int *var,
+			  const char *set_doc, const char *show_doc,
+			  const char *help_doc,
+			  cmd_sfunc_ftype *set_func,
+			  show_value_ftype *show_func,
+			  struct cmd_list_element **set_list,
+			  struct cmd_list_element **show_list)
+{
+  add_setshow_cmd_full (name, class, var_integer, var,
+			set_doc, show_doc, help_doc,
+			set_func, show_func,
+			set_list, show_list,
+			NULL, NULL);
+}
+
+/* Add element named NAME to both the set and show command LISTs (the
+   list for set/show or some sublist thereof).  CLASS is as in
+   add_cmd.  VAR is address of the variable which will contain the
+   value.  SET_DOC and SHOW_DOC are the documentation strings.  */
+void
 add_setshow_uinteger_cmd (char *name, enum command_class class,
 			  unsigned int *var,
 			  const char *set_doc, const char *show_doc,

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