* cli/cli-decode.c (add_set_boolean_cmd): Define.
authorAndrew Cagney <cagney@redhat.com>
Sun, 30 Sep 2001 16:16:16 +0000 (16:16 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sun, 30 Sep 2001 16:16:16 +0000 (16:16 +0000)
* cli/cli-decode.h (add_set_boolean_cmd): Declare.
* command.h (add_set_boolean_cmd): Ditto.
* remote.c (_initialize_remote): Use add_set_boolean_cmd for "set
remotebreak"

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

index bc52b07e03dff484b9329568b5b62a6165c1f659..c6b61f645f0b4ccf29743f27e64cd9015c946e58 100644 (file)
@@ -1,3 +1,11 @@
+2001-09-29  Andrew Cagney  <ac131313@redhat.com>
+
+       * cli/cli-decode.c (add_set_boolean_cmd): Define.
+       * cli/cli-decode.h (add_set_boolean_cmd): Declare.
+       * command.h (add_set_boolean_cmd): Ditto.
+       * remote.c (_initialize_remote): Use add_set_boolean_cmd for "set
+       remotebreak"
+
 2001-09-29  Andrew Cagney  <ac131313@redhat.com>
 
        * gdbarch.sh (gdbarch_dump): Sort output.
index d2fea6ea7a48f51dad109cda86193fbc99997c95..bb9eb949627353ce6af143078d612e44a2869213 100644 (file)
@@ -291,6 +291,25 @@ add_set_auto_boolean_cmd (char *name,
   return c;
 }
 
+/* Add element named NAME to command list LIST (the list for set
+   or some sublist thereof).
+   CLASS is as in add_cmd.
+   VAR is address of the variable which will contain the value.
+   DOC is the documentation string.  */
+struct cmd_list_element *
+add_set_boolean_cmd (char *name,
+                    enum command_class class,
+                    int *var,
+                    char *doc,
+                    struct cmd_list_element **list)
+{
+  static const char *boolean_enums[] = { "on", "off", NULL };
+  struct cmd_list_element *c;
+  c = add_set_cmd (name, class, var_boolean, var, doc, list);
+  c->enums = boolean_enums;
+  return c;
+}
+
 /* Where SETCMD has already been added, add the corresponding show
    command to LIST and return a pointer to the added command (not 
    necessarily the head of LIST).  */
index 79f39d2788769452bdc8ac7b454ac16188698a17..d35685c4f920dcceb1d2bcfd0764003795c08acd 100644 (file)
@@ -329,6 +329,12 @@ extern struct cmd_list_element *add_set_auto_boolean_cmd (char *name,
                                                          char *doc,
                                                          struct cmd_list_element **list);
 
+extern struct cmd_list_element *add_set_boolean_cmd (char *name,
+                                                    enum command_class class,
+                                                    int *var,
+                                                    char *doc,
+                                                    struct cmd_list_element **list);
+
 extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *,
                                                   struct cmd_list_element
                                                   **);
index ac528212c34b6478347daa484732b2915fe2d695..20ebef2b46faee905e7df55ccdc49a185ee5095c 100644 (file)
@@ -340,6 +340,12 @@ extern struct cmd_list_element *add_set_auto_boolean_cmd (char *name,
                                                          char *doc,
                                                          struct cmd_list_element **list);
 
+extern struct cmd_list_element *add_set_boolean_cmd (char *name,
+                                                    enum command_class class,
+                                                    int *var,
+                                                    char *doc,
+                                                    struct cmd_list_element **list);
+
 extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *,
                                                   struct cmd_list_element
                                                   **);
index ecf9afcfea96273cb6dae6261c69a6005dd572e8..0555088bdf45e6265c8e79f618a435cc91b8fa46 100644 (file)
@@ -5877,10 +5877,9 @@ terminating `#' character and checksum.",
           &maintenancelist);
 
   add_show_from_set
-    (add_set_cmd ("remotebreak", no_class,
-                 var_boolean, (char *) &remote_break,
-                 "Set whether to send break if interrupted.\n",
-                 &setlist),
+    (add_set_boolean_cmd ("remotebreak", no_class, &remote_break,
+                         "Set whether to send break if interrupted.\n",
+                         &setlist),
      &showlist);
 
   /* Install commands for configuring memory read/write packets. */