Fix -Wuninitialized warnings.
[deliverable/binutils-gdb.git] / gdb / command.c
index 737ac77122294d3b73e057ab4a332f430c6c9c0e..6e64de42f7166b3245d2e8a67b40568313ad372f 100644 (file)
 
 /* Prototypes for local functions */
 
-static void undef_cmd_error PARAMS ((char *, char *));
+static void undef_cmd_error (char *, char *);
 
-static void show_user PARAMS ((char *, int));
+static void show_user (char *, int);
 
 static void show_user_1 (struct cmd_list_element *, struct ui_file *);
 
-static void make_command PARAMS ((char *, int));
+static void make_command (char *, int);
 
-static void shell_escape PARAMS ((char *, int));
+static void shell_escape (char *, int);
 
-static int parse_binary_operation PARAMS ((char *));
+static int parse_binary_operation (char *);
 
 static void print_doc_line (struct ui_file *, char *);
 
-static struct cmd_list_element *find_cmd PARAMS ((char *command,
-                                                 int len,
-                                           struct cmd_list_element * clist,
-                                                 int ignore_help_classes,
-                                                 int *nfound));
+static struct cmd_list_element *find_cmd (char *command,
+                                         int len,
+                                         struct cmd_list_element *clist,
+                                         int ignore_help_classes,
+                                         int *nfound);
 static void apropos_cmd_helper (struct ui_file *, struct cmd_list_element *, 
                                struct re_pattern_buffer *, char *);
 
+static void help_all (struct ui_file *stream);
+
 void apropos_command (char *, int);
 
-void _initialize_command PARAMS ((void));
+void _initialize_command (void);
 
 /* Add element named NAME.
    CLASS is the top level category into which commands are broken down
@@ -79,12 +81,8 @@ void _initialize_command PARAMS ((void));
    of *LIST). */
 
 struct cmd_list_element *
-add_cmd (name, class, fun, doc, list)
-     char *name;
-     enum command_class class;
-     void (*fun) PARAMS ((char *, int));
-     char *doc;
-     struct cmd_list_element **list;
+add_cmd (char *name, enum command_class class, void (*fun) (char *, int),
+        char *doc, struct cmd_list_element **list)
 {
   register struct cmd_list_element *c
   = (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
@@ -114,7 +112,9 @@ add_cmd (name, class, fun, doc, list)
   c->doc = doc;
   c->flags = 0;
   c->replacement = NULL;
-  c->hook = NULL;
+  c->hook_pre  = NULL;
+  c->hook_post = NULL;
+  c->hook_in = 0;
   c->prefixlist = NULL;
   c->prefixname = NULL;
   c->allow_unknown = 0;
@@ -125,7 +125,8 @@ add_cmd (name, class, fun, doc, list)
   c->var_type = var_boolean;
   c->enums = NULL;
   c->user_commands = NULL;
-  c->hookee = NULL;
+  c->hookee_pre = NULL;
+  c->hookee_post = NULL;
   c->cmd_pointer = NULL;
 
   return c;
@@ -143,9 +144,7 @@ add_cmd (name, class, fun, doc, list)
    Returns a pointer to the deprecated command.  */
 
 struct cmd_list_element *
-deprecate_cmd (cmd, replacement)
-     struct cmd_list_element *cmd;
-     char *replacement;
+deprecate_cmd (struct cmd_list_element *cmd, char *replacement)
 {
   cmd->flags |= (CMD_DEPRECATED | DEPRECATED_WARN_USER);
 
@@ -163,12 +162,8 @@ deprecate_cmd (cmd, replacement)
 #if 0                          /* Currently unused */
 
 struct cmd_list_element *
-add_abbrev_cmd (name, class, fun, doc, list)
-     char *name;
-     enum command_class class;
-     void (*fun) PARAMS ((char *, int));
-     char *doc;
-     struct cmd_list_element **list;
+add_abbrev_cmd (char *name, enum command_class class, void (*fun) (char *, int),
+               char *doc, struct cmd_list_element **list)
 {
   register struct cmd_list_element *c
   = add_cmd (name, class, fun, doc, list);
@@ -180,12 +175,8 @@ add_abbrev_cmd (name, class, fun, doc, list)
 #endif
 
 struct cmd_list_element *
-add_alias_cmd (name, oldname, class, abbrev_flag, list)
-     char *name;
-     char *oldname;
-     enum command_class class;
-     int abbrev_flag;
-     struct cmd_list_element **list;
+add_alias_cmd (char *name, char *oldname, enum command_class class,
+              int abbrev_flag, struct cmd_list_element **list)
 {
   /* Must do this since lookup_cmd tries to side-effect its first arg */
   char *copied_name;
@@ -216,16 +207,10 @@ add_alias_cmd (name, oldname, class, abbrev_flag, list)
    of the variable containing that list.  */
 
 struct cmd_list_element *
-add_prefix_cmd (name, class, fun, doc, prefixlist, prefixname,
-               allow_unknown, list)
-     char *name;
-     enum command_class class;
-     void (*fun) PARAMS ((char *, int));
-     char *doc;
-     struct cmd_list_element **prefixlist;
-     char *prefixname;
-     int allow_unknown;
-     struct cmd_list_element **list;
+add_prefix_cmd (char *name, enum command_class class, void (*fun) (char *, int),
+               char *doc, struct cmd_list_element **prefixlist,
+               char *prefixname, int allow_unknown,
+               struct cmd_list_element **list)
 {
   register struct cmd_list_element *c = add_cmd (name, class, fun, doc, list);
   c->prefixlist = prefixlist;
@@ -237,16 +222,10 @@ add_prefix_cmd (name, class, fun, doc, prefixlist, prefixname,
 /* Like add_prefix_cmd but sets the abbrev_flag on the new command. */
 
 struct cmd_list_element *
-add_abbrev_prefix_cmd (name, class, fun, doc, prefixlist, prefixname,
-                      allow_unknown, list)
-     char *name;
-     enum command_class class;
-     void (*fun) PARAMS ((char *, int));
-     char *doc;
-     struct cmd_list_element **prefixlist;
-     char *prefixname;
-     int allow_unknown;
-     struct cmd_list_element **list;
+add_abbrev_prefix_cmd (char *name, enum command_class class,
+                      void (*fun) (char *, int), char *doc,
+                      struct cmd_list_element **prefixlist, char *prefixname,
+                      int allow_unknown, struct cmd_list_element **list)
 {
   register struct cmd_list_element *c = add_cmd (name, class, fun, doc, list);
   c->prefixlist = prefixlist;
@@ -258,20 +237,15 @@ add_abbrev_prefix_cmd (name, class, fun, doc, prefixlist, prefixname,
 
 /* This is an empty "cfunc".  */
 void
-not_just_help_class_command (args, from_tty)
-     char *args;
-     int from_tty;
+not_just_help_class_command (char *args, int from_tty)
 {
 }
 
 /* This is an empty "sfunc".  */
-static void empty_sfunc PARAMS ((char *, int, struct cmd_list_element *));
+static void empty_sfunc (char *, int, struct cmd_list_element *);
 
 static void
-empty_sfunc (args, from_tty, c)
-     char *args;
-     int from_tty;
-     struct cmd_list_element *c;
+empty_sfunc (char *args, int from_tty, struct cmd_list_element *c)
 {
 }
 
@@ -283,13 +257,12 @@ empty_sfunc (args, from_tty, c)
    DOC is the documentation string.  */
 
 struct cmd_list_element *
-add_set_cmd (name, class, var_type, var, doc, list)
-     char *name;
-     enum command_class class;
-     var_types var_type;
-     char *var;
-     char *doc;
-     struct cmd_list_element **list;
+add_set_cmd (char *name,
+            enum command_class class,
+            var_types var_type,
+            void *var,
+            char *doc,
+            struct cmd_list_element **list)
 {
   struct cmd_list_element *c
   = add_cmd (name, class, NO_FUNCTION, doc, list);
@@ -312,13 +285,12 @@ add_set_cmd (name, class, var_type, var, doc, list)
    DOC is the documentation string.  */
 
 struct cmd_list_element *
-add_set_enum_cmd (name, class, enumlist, var, doc, list)
-     char *name;
-     enum command_class class;
-     char *enumlist[];
-     char *var;
-     char *doc;
-     struct cmd_list_element **list;
+add_set_enum_cmd (char *name,
+                 enum command_class class,
+                 const char *enumlist[],
+                 const char **var,
+                 char *doc,
+                 struct cmd_list_element **list)
 {
   struct cmd_list_element *c
   = add_set_cmd (name, class, var_enum, var, doc, list);
@@ -327,13 +299,31 @@ add_set_enum_cmd (name, class, enumlist, var, doc, list)
   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_auto_boolean_cmd (char *name,
+                         enum command_class class,
+                         enum cmd_auto_boolean *var,
+                         char *doc,
+                         struct cmd_list_element **list)
+{
+  static const char *auto_boolean_enums[] = { "on", "off", "auto", NULL };
+  struct cmd_list_element *c;
+  c = add_set_cmd (name, class, var_auto_boolean, var, doc, list);
+  c->enums = auto_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).  */
 struct cmd_list_element *
-add_show_from_set (setcmd, list)
-     struct cmd_list_element *setcmd;
-     struct cmd_list_element **list;
+add_show_from_set (struct cmd_list_element *setcmd,
+                  struct cmd_list_element **list)
 {
   struct cmd_list_element *showcmd =
   (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
@@ -372,17 +362,17 @@ add_show_from_set (setcmd, list)
 /* Remove the command named NAME from the command list.  */
 
 void
-delete_cmd (name, list)
-     char *name;
-     struct cmd_list_element **list;
+delete_cmd (char *name, struct cmd_list_element **list)
 {
   register struct cmd_list_element *c;
   struct cmd_list_element *p;
 
   while (*list && STREQ ((*list)->name, name))
     {
-      if ((*list)->hookee)
-       (*list)->hookee->hook = 0;      /* Hook slips out of its mouth */
+      if ((*list)->hookee_pre)
+      (*list)->hookee_pre->hook_pre = 0;   /* Hook slips out of its mouth */
+      if ((*list)->hookee_post)
+      (*list)->hookee_post->hook_post = 0; /* Hook slips out of its bottom  */
       p = (*list)->next;
       free ((PTR) * list);
       *list = p;
@@ -393,8 +383,11 @@ delete_cmd (name, list)
       {
        if (STREQ (c->next->name, name))
          {
-           if (c->next->hookee)
-             c->next->hookee->hook = 0;        /* hooked cmd gets away.  */
+          if (c->next->hookee_pre)
+            c->next->hookee_pre->hook_pre = 0; /* hooked cmd gets away.  */
+          if (c->next->hookee_post)
+            c->next->hookee_post->hook_post = 0; /* remove post hook */
+                                               /* :( no fishing metaphore */
            p = c->next->next;
            free ((PTR) c->next);
            c->next = p;
@@ -497,9 +490,7 @@ apropos_command (char *searchstr, int from_tty)
  */
 
 void
-help_cmd (command, stream)
-     char *command;
-     struct ui_file *stream;
+help_cmd (char *command, struct ui_file *stream)
 {
   struct cmd_list_element *c;
   extern struct cmd_list_element *cmdlist;
@@ -510,6 +501,12 @@ help_cmd (command, stream)
       return;
     }
 
+  if (strcmp (command, "all") == 0)
+    {
+      help_all (stream);
+      return;
+    }
+
   c = lookup_cmd (&command, cmdlist, "", 0, 0);
 
   if (c == 0)
@@ -542,9 +539,18 @@ help_cmd (command, stream)
   if (c->function.cfunc == NULL)
     help_list (cmdlist, "", c->class, stream);
 
-  if (c->hook)
-    fprintf_filtered (stream, "\nThis command has a hook defined: %s\n",
-                     c->hook->name);
+  if (c->hook_pre || c->hook_post)
+    fprintf_filtered (stream,
+                      "\nThis command has a hook (or hooks) defined:\n");
+
+  if (c->hook_pre)
+    fprintf_filtered (stream, 
+                      "\tThis command is run after  : %s (pre hook)\n",
+                    c->hook_pre->name);
+  if (c->hook_post)
+    fprintf_filtered (stream, 
+                      "\tThis command is run before : %s (post hook)\n",
+                    c->hook_post->name);
 }
 
 /*
@@ -560,11 +566,8 @@ help_cmd (command, stream)
  * If you call this routine with a class >= 0, it recurses.
  */
 void
-help_list (list, cmdtype, class, stream)
-     struct cmd_list_element *list;
-     char *cmdtype;
-     enum command_class class;
-     struct ui_file *stream;
+help_list (struct cmd_list_element *list, char *cmdtype,
+          enum command_class class, struct ui_file *stream)
 {
   int len;
   char *cmdtype1, *cmdtype2;
@@ -602,11 +605,29 @@ Command name abbreviations are allowed if unambiguous.\n",
                    cmdtype1, cmdtype2);
 }
 
+static void
+help_all (struct ui_file *stream)
+{
+  struct cmd_list_element *c;
+  extern struct cmd_list_element *cmdlist;
+
+  for (c = cmdlist; c; c = c->next)
+    {
+      if (c->abbrev_flag)
+        continue;
+      /* If this is a prefix command, print it's subcommands */
+      if (c->prefixlist)
+        help_cmd_list (*c->prefixlist, all_commands, c->prefixname, 0, stream);
+    
+      /* If this is a class name, print all of the commands in the class */
+      else if (c->function.cfunc == NULL)
+        help_cmd_list (cmdlist, c->class, "", 0, stream);
+    }
+}
+
 /* Print only the first line of STR on STREAM.  */
 static void
-print_doc_line (stream, str)
-     struct ui_file *stream;
-     char *str;
+print_doc_line (struct ui_file *stream, char *str)
 {
   static char *line_buffer = 0;
   static int line_size;
@@ -655,12 +676,8 @@ print_doc_line (stream, str)
  * is at the low level, not the high-level).
  */
 void
-help_cmd_list (list, class, prefix, recurse, stream)
-     struct cmd_list_element *list;
-     enum command_class class;
-     char *prefix;
-     int recurse;
-     struct ui_file *stream;
+help_cmd_list (struct cmd_list_element *list, enum command_class class,
+              char *prefix, int recurse, struct ui_file *stream)
 {
   register struct cmd_list_element *c;
 
@@ -688,12 +705,8 @@ help_cmd_list (list, class, prefix, recurse, stream)
    found in nfound */
 
 static struct cmd_list_element *
-find_cmd (command, len, clist, ignore_help_classes, nfound)
-     char *command;
-     int len;
-     struct cmd_list_element *clist;
-     int ignore_help_classes;
-     int *nfound;
+find_cmd (char *command, int len, struct cmd_list_element *clist,
+         int ignore_help_classes, int *nfound)
 {
   struct cmd_list_element *found, *c;
 
@@ -751,10 +764,8 @@ find_cmd (command, len, clist, ignore_help_classes, nfound)
    the struct cmd_list_element is NULL).  */
 
 struct cmd_list_element *
-lookup_cmd_1 (text, clist, result_list, ignore_help_classes)
-     char **text;
-     struct cmd_list_element *clist, **result_list;
-     int ignore_help_classes;
+lookup_cmd_1 (char **text, struct cmd_list_element *clist,
+             struct cmd_list_element **result_list, int ignore_help_classes)
 {
   char *p, *command;
   int len, tmp, nfound;
@@ -886,8 +897,7 @@ lookup_cmd_1 (text, clist, result_list, ignore_help_classes)
 /* All this hair to move the space to the front of cmdtype */
 
 static void
-undef_cmd_error (cmdtype, q)
-     char *cmdtype, *q;
+undef_cmd_error (char *cmdtype, char *q)
 {
   error ("Undefined %scommand: \"%s\".  Try \"help%s%.*s\".",
         cmdtype,
@@ -912,12 +922,8 @@ undef_cmd_error (cmdtype, q)
    the function field of the struct cmd_list_element is 0).  */
 
 struct cmd_list_element *
-lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
-     char **line;
-     struct cmd_list_element *list;
-     char *cmdtype;
-     int allow_unknown;
-     int ignore_help_classes;
+lookup_cmd (char **line, struct cmd_list_element *list, char *cmdtype,
+           int allow_unknown, int ignore_help_classes)
 {
   struct cmd_list_element *last_list = 0;
   struct cmd_list_element *c =
@@ -1234,11 +1240,8 @@ lookup_cmd_composition (char *text,
    CMDTYPE precedes the word "command" in the error message.  */
 
 struct cmd_list_element *
-lookup_cmd (line, list, cmdtype, allow_unknown)
-     char **line;
-     struct cmd_list_element *list;
-     char *cmdtype;
-     int allow_unknown;
+lookup_cmd (char **line, struct cmd_list_element *list, char *cmdtype,
+           int allow_unknown)
 {
   register char *p;
   register struct cmd_list_element *c, *found;
@@ -1370,10 +1373,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown)
    "oobar"; if WORD is "baz/foo", return "baz/foobar".  */
 
 char **
-complete_on_cmdlist (list, text, word)
-     struct cmd_list_element *list;
-     char *text;
-     char *word;
+complete_on_cmdlist (struct cmd_list_element *list, char *text, char *word)
 {
   struct cmd_list_element *ptr;
   char **matchlist;
@@ -1444,17 +1444,16 @@ complete_on_cmdlist (list, text, word)
    "oobar"; if WORD is "baz/foo", return "baz/foobar".  */
 
 char **
-complete_on_enum (enumlist, text, word)
-     char **enumlist;
-     char *text;
-     char *word;
+complete_on_enum (const char *enumlist[],
+                 char *text,
+                 char *word)
 {
   char **matchlist;
   int sizeof_matchlist;
   int matches;
   int textlen = strlen (text);
   int i;
-  char *name;
+  const char *name;
 
   sizeof_matchlist = 10;
   matchlist = (char **) xmalloc (sizeof_matchlist * sizeof (char *));
@@ -1505,9 +1504,34 @@ complete_on_enum (enumlist, text, word)
   return matchlist;
 }
 
+static enum cmd_auto_boolean
+parse_auto_binary_operation (const char *arg)
+{
+  if (arg != NULL && *arg != '\0')
+    {
+      int length = strlen (arg);
+      while (isspace (arg[length - 1]) && length > 0)
+       length--;
+      if (strncmp (arg, "on", length) == 0
+         || strncmp (arg, "1", length) == 0
+         || strncmp (arg, "yes", length) == 0
+         || strncmp (arg, "enable", length) == 0)
+       return CMD_AUTO_BOOLEAN_TRUE;
+      else if (strncmp (arg, "off", length) == 0
+              || strncmp (arg, "0", length) == 0
+              || strncmp (arg, "no", length) == 0
+              || strncmp (arg, "disable", length) == 0)
+       return CMD_AUTO_BOOLEAN_FALSE;
+      else if (strncmp (arg, "auto", length) == 0
+              || (strncmp (arg, "-1", length) == 0 && length > 1))
+       return CMD_AUTO_BOOLEAN_AUTO;
+    }
+  error ("\"on\", \"off\" or \"auto\" expected.");
+  return CMD_AUTO_BOOLEAN_AUTO; /* pacify GCC */
+}
+
 static int
-parse_binary_operation (arg)
-     char *arg;
+parse_binary_operation (char *arg)
 {
   int length;
 
@@ -1519,13 +1543,15 @@ parse_binary_operation (arg)
   while (arg[length - 1] == ' ' || arg[length - 1] == '\t')
     length--;
 
-  if (!strncmp (arg, "on", length)
-      || !strncmp (arg, "1", length)
-      || !strncmp (arg, "yes", length))
+  if (strncmp (arg, "on", length) == 0
+      || strncmp (arg, "1", length) == 0
+      || strncmp (arg, "yes", length) == 0
+      || strncmp (arg, "enable", length) == 0)
     return 1;
-  else if (!strncmp (arg, "off", length)
-          || !strncmp (arg, "0", length)
-          || !strncmp (arg, "no", length))
+  else if (strncmp (arg, "off", length) == 0
+          || strncmp (arg, "0", length) == 0
+          || strncmp (arg, "no", length) == 0
+          || strncmp (arg, "disable", length) == 0)
     return 0;
   else
     {
@@ -1539,10 +1565,7 @@ parse_binary_operation (arg)
    directly by the user (i.e. these are just like any other
    command).  C is the command list element for the command.  */
 void
-do_setshow_command (arg, from_tty, c)
-     char *arg;
-     int from_tty;
-     struct cmd_list_element *c;
+do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
 {
   if (c->type == set_cmd)
     {
@@ -1610,10 +1633,13 @@ do_setshow_command (arg, from_tty, c)
        case var_boolean:
          *(int *) c->var = parse_binary_operation (arg);
          break;
+       case var_auto_boolean:
+         *(enum cmd_auto_boolean *) c->var = parse_auto_binary_operation (arg);
+         break;
        case var_uinteger:
          if (arg == NULL)
            error_no_arg ("integer to set it to.");
-         *(unsigned int *) c->var = parse_and_eval_address (arg);
+         *(unsigned int *) c->var = parse_and_eval_long (arg);
          if (*(unsigned int *) c->var == 0)
            *(unsigned int *) c->var = UINT_MAX;
          break;
@@ -1622,7 +1648,7 @@ do_setshow_command (arg, from_tty, c)
            unsigned int val;
            if (arg == NULL)
              error_no_arg ("integer to set it to.");
-           val = parse_and_eval_address (arg);
+           val = parse_and_eval_long (arg);
            if (val == 0)
              *(int *) c->var = INT_MAX;
            else if (val >= INT_MAX)
@@ -1634,14 +1660,14 @@ do_setshow_command (arg, from_tty, c)
        case var_zinteger:
          if (arg == NULL)
            error_no_arg ("integer to set it to.");
-         *(int *) c->var = parse_and_eval_address (arg);
+         *(int *) c->var = parse_and_eval_long (arg);
          break;
        case var_enum:
          {
            int i;
            int len;
            int nmatches;
-           char *match = NULL;
+           const char *match = NULL;
            char *p;
 
            /* if no argument was supplied, print an informative error message */
@@ -1670,8 +1696,17 @@ do_setshow_command (arg, from_tty, c)
            for (i = 0; c->enums[i]; i++)
              if (strncmp (arg, c->enums[i], len) == 0)
                {
-                 match = c->enums[i];
-                 nmatches++;
+                 if (c->enums[i][len] == '\0')
+                   {
+                     match = c->enums[i];
+                     nmatches = 1;
+                     break; /* exact match. */
+                   }
+                 else
+                   {
+                     match = c->enums[i];
+                     nmatches++;
+                   }
                }
 
            if (nmatches <= 0)
@@ -1680,7 +1715,7 @@ do_setshow_command (arg, from_tty, c)
            if (nmatches > 1)
              error ("Ambiguous item \"%s\".", arg);
 
-           *(char **) c->var = match;
+           *(const char **) c->var = match;
          }
          break;
        default:
@@ -1695,7 +1730,7 @@ do_setshow_command (arg, from_tty, c)
       int quote;
 
       stb = ui_out_stream_new (uiout);
-      old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb);
+      old_chain = make_cleanup_ui_out_stream_delete (stb);
 #endif /* UI_OUT */
 
       /* Print doc minus "show" at start.  */
@@ -1726,6 +1761,23 @@ do_setshow_command (arg, from_tty, c)
        case var_boolean:
          fputs_filtered (*(int *) c->var ? "on" : "off", stb->stream);
          break;
+       case var_auto_boolean:
+         switch (*(enum cmd_auto_boolean*) c->var)
+           {
+           case CMD_AUTO_BOOLEAN_TRUE:
+             fputs_filtered ("on", stb->stream);
+             break;
+           case CMD_AUTO_BOOLEAN_FALSE:
+             fputs_filtered ("off", stb->stream);
+             break;
+           case CMD_AUTO_BOOLEAN_AUTO:
+             fputs_filtered ("auto", stb->stream);
+             break;
+           default:
+             internal_error ("do_setshow_command: invalid var_auto_boolean");
+             break;
+           }
+         break;
        case var_uinteger:
          if (*(unsigned int *) c->var == UINT_MAX)
            {
@@ -1779,6 +1831,23 @@ do_setshow_command (arg, from_tty, c)
        case var_boolean:
          fputs_filtered (*(int *) c->var ? "on" : "off", gdb_stdout);
          break;
+       case var_auto_boolean:
+         switch (*(enum cmd_auto_boolean*) c->var)
+           {
+           case CMD_AUTO_BOOLEAN_TRUE:
+             fputs_filtered ("on", gdb_stdout);
+             break;
+           case CMD_AUTO_BOOLEAN_FALSE:
+             fputs_filtered ("off", gdb_stdout);
+             break;
+           case CMD_AUTO_BOOLEAN_AUTO:
+             fputs_filtered ("auto", gdb_stdout);
+             break;
+           default:
+             internal_error ("do_setshow_command: invalid var_auto_boolean");
+             break;
+           }
+         break;
        case var_uinteger:
          if (*(unsigned int *) c->var == UINT_MAX)
            {
@@ -1814,10 +1883,7 @@ do_setshow_command (arg, from_tty, c)
 /* Show all the settings in a list of show commands.  */
 
 void
-cmd_show_list (list, from_tty, prefix)
-     struct cmd_list_element *list;
-     int from_tty;
-     char *prefix;
+cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix)
 {
 #ifdef UI_OUT
   ui_out_list_begin (uiout, "showlist");
@@ -1862,9 +1928,7 @@ cmd_show_list (list, from_tty, prefix)
 
 /* ARGSUSED */
 static void
-shell_escape (arg, from_tty)
-     char *arg;
-     int from_tty;
+shell_escape (char *arg, int from_tty)
 {
 #ifdef CANT_FORK
   /* If ARG is NULL, they want an inferior shell, but `system' just
@@ -1925,9 +1989,7 @@ shell_escape (arg, from_tty)
 }
 
 static void
-make_command (arg, from_tty)
-     char *arg;
-     int from_tty;
+make_command (char *arg, int from_tty)
 {
   char *p;
 
@@ -1944,9 +2006,7 @@ make_command (arg, from_tty)
 }
 
 static void
-show_user_1 (c, stream)
-     struct cmd_list_element *c;
-     struct ui_file *stream;
+show_user_1 (struct cmd_list_element *c, struct ui_file *stream)
 {
   register struct command_line *cmdlines;
 
@@ -1972,9 +2032,7 @@ show_user_1 (c, stream)
 
 /* ARGSUSED */
 static void
-show_user (args, from_tty)
-     char *args;
-     int from_tty;
+show_user (char *args, int from_tty)
 {
   struct cmd_list_element *c;
   extern struct cmd_list_element *cmdlist;
@@ -1997,14 +2055,14 @@ show_user (args, from_tty)
 }
 
 void
-_initialize_command ()
+_initialize_command (void)
 {
   add_com ("shell", class_support, shell_escape,
           "Execute the rest of the line as a shell command.  \n\
 With no arguments, run an inferior shell.");
 
   /* NOTE: cagney/2000-03-20: Being able to enter ``(gdb) !ls'' would
-     be a really useful feature.  Unfortunatly, the below wont do
+     be a really useful feature.  Unfortunately, the below wont do
      this.  Instead it adds support for the form ``(gdb) ! ls''
      (i.e. the space is required).  If the ``!'' command below is
      added the complains about no ``!'' command would be replaced by
This page took 0.040842 seconds and 4 git commands to generate.