2005-02-18 Andrew Cagney <cagney@gnu.org>
authorAndrew Cagney <cagney@redhat.com>
Fri, 18 Feb 2005 20:57:16 +0000 (20:57 +0000)
committerAndrew Cagney <cagney@redhat.com>
Fri, 18 Feb 2005 20:57:16 +0000 (20:57 +0000)
* cli/cli-decode.c (add_setshow_integer_cmd): New function.
* command.h (add_setshow_integer_cmd): Declare.
* cli/cli-cmds.c: Update.

gdb/ChangeLog
gdb/cli/cli-cmds.c
gdb/cli/cli-decode.c
gdb/command.h

index c39be4e00fccc09556f1f897489e60699af1a813..860b76d3555079cfece5ddcce6d509bd69db0663 100644 (file)
@@ -1,5 +1,9 @@
 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.
+       
        Use add_setshow_uinteger_cmd through out.
        * printcmd.c, source.c, utils.c, valprint.c: Update.
 
index 4f265b87ad6722e47fd4d0d32e5f71f42a2fcf20..de8a029436f2e1c0cbce429232d5063c2afff6d9 100644 (file)
@@ -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 all user defined commands."), &showlist);
   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 f9e2925e9c0400b518ba419d890cf341b585b31d..ec2f734cac11e5e34ae400e26b70a6c15df522f7 100644 (file)
@@ -535,6 +535,27 @@ add_setshow_string_noescape_cmd (char *name, enum command_class class,
                        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_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
index 01eb0de9eb9071234f0cef97d8f5e0621f169ab8..dcebe49be8a64714c7308182cbb368f3316d927b 100644 (file)
@@ -301,6 +301,17 @@ extern void add_setshow_string_noescape_cmd (char *name,
                                             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,