make calls to help_list use enumerator
authorTom Tromey <tromey@redhat.com>
Thu, 5 Jun 2014 14:25:00 +0000 (08:25 -0600)
committerTom Tromey <tromey@redhat.com>
Fri, 13 Jun 2014 15:29:19 +0000 (09:29 -0600)
Currently there are many calls to help_list that pass the constant -1
as the "class" value.  However, the parameter is declared as being of
type enum command_class, and uses of the constant violate this
abstraction.

This patch fixes the error everywhere it occurs in the gdb sources.

Tested by rebuilding.

2014-06-13  Tom Tromey  <tromey@redhat.com>

* cp-support.c (maint_cplus_command): Pass all_commands, not -1,
to help_list.
* guile/guile.c (info_guile_command): Pass all_commands, not -1,
to help_list.
* tui/tui-win.c (tui_command): Pass all_commands, not -1, to
help_list.
* tui/tui-regs.c (tui_reg_command): Pass all_commands, not -1, to
help_list.Pass all_commands, not -1, to help_list.
* cli/cli-dump.c (dump_command, append_command)
(srec_dump_command, ihex_dump_command, tekhex_dump_command)
(binary_dump_command, binary_append_command): Pass all_commands,
not -1, to help_list.
* cli/cli-cmds.c (info_command, set_debug): Pass all_commands, not
-1, to help_list.
* valprint.c (set_print, set_print_raw): Pass all_commands, not
-1, to help_list.
* typeprint.c (set_print_type): Pass all_commands, not -1, to
help_list.
* top.c (set_history): Pass all_commands, not -1, to help_list.
* target-descriptions.c (set_tdesc_cmd, unset_tdesc_cmd): Pass
all_commands, not -1, to help_list.
* symfile.c (overlay_command): Pass all_commands, not -1, to
help_list.
* spu-tdep.c (info_spu_command): Pass all_commands, not -1, to
help_list.
* serial.c (serial_set_cmd): Pass all_commands, not -1, to
help_list.
* ser-tcp.c (set_tcp_cmd, show_tcp_cmd): Pass all_commands, not
-1, to help_list.
* remote.c (remote_command, set_remote_cmd): Pass all_commands,
not -1, to help_list.
* ravenscar-thread.c (set_ravenscar_command): Pass all_commands,
not -1, to help_list.
* maint.c (maintenance_command, maintenance_info_command)
(maintenance_print_command, maintenance_set_cmd): Pass
all_commands, not -1, to help_list.
* macrocmd.c (macro_command): Pass all_commands, not -1, to
help_list.
* language.c (set_check): Pass all_commands, not -1, to help_list.
* infcmd.c (unset_command): Pass all_commands, not -1, to
help_list.
* frame.c (set_backtrace_cmd): Pass all_commands, not -1, to
help_list.
* dwarf2read.c (set_dwarf2_cmd): Pass all_commands, not -1, to
help_list.
* dcache.c (set_dcache_command): Pass all_commands, not -1, to
help_list.
* breakpoint.c (save_command): Pass all_commands, not -1, to
help_list.
* ada-lang.c (maint_set_ada_cmd, set_ada_command): Pass
all_commands, not -1, to help_list.

26 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/breakpoint.c
gdb/cli/cli-cmds.c
gdb/cli/cli-dump.c
gdb/cp-support.c
gdb/dcache.c
gdb/dwarf2read.c
gdb/frame.c
gdb/guile/guile.c
gdb/infcmd.c
gdb/language.c
gdb/macrocmd.c
gdb/maint.c
gdb/ravenscar-thread.c
gdb/remote.c
gdb/ser-tcp.c
gdb/serial.c
gdb/spu-tdep.c
gdb/symfile.c
gdb/target-descriptions.c
gdb/top.c
gdb/tui/tui-regs.c
gdb/tui/tui-win.c
gdb/typeprint.c
gdb/valprint.c

index 59bd163..7f2d694 100644 (file)
@@ -1,3 +1,57 @@
+2014-06-13  Tom Tromey  <tromey@redhat.com>
+
+       * cp-support.c (maint_cplus_command): Pass all_commands, not -1,
+       to help_list.
+       * guile/guile.c (info_guile_command): Pass all_commands, not -1,
+       to help_list.
+       * tui/tui-win.c (tui_command): Pass all_commands, not -1, to
+       help_list.
+       * tui/tui-regs.c (tui_reg_command): Pass all_commands, not -1, to
+       help_list.Pass all_commands, not -1, to help_list.
+       * cli/cli-dump.c (dump_command, append_command)
+       (srec_dump_command, ihex_dump_command, tekhex_dump_command)
+       (binary_dump_command, binary_append_command): Pass all_commands,
+       not -1, to help_list.
+       * cli/cli-cmds.c (info_command, set_debug): Pass all_commands, not
+       -1, to help_list.
+       * valprint.c (set_print, set_print_raw): Pass all_commands, not
+       -1, to help_list.
+       * typeprint.c (set_print_type): Pass all_commands, not -1, to
+       help_list.
+       * top.c (set_history): Pass all_commands, not -1, to help_list.
+       * target-descriptions.c (set_tdesc_cmd, unset_tdesc_cmd): Pass
+       all_commands, not -1, to help_list.
+       * symfile.c (overlay_command): Pass all_commands, not -1, to
+       help_list.
+       * spu-tdep.c (info_spu_command): Pass all_commands, not -1, to
+       help_list.
+       * serial.c (serial_set_cmd): Pass all_commands, not -1, to
+       help_list.
+       * ser-tcp.c (set_tcp_cmd, show_tcp_cmd): Pass all_commands, not
+       -1, to help_list.
+       * remote.c (remote_command, set_remote_cmd): Pass all_commands,
+       not -1, to help_list.
+       * ravenscar-thread.c (set_ravenscar_command): Pass all_commands,
+       not -1, to help_list.
+       * maint.c (maintenance_command, maintenance_info_command)
+       (maintenance_print_command, maintenance_set_cmd): Pass
+       all_commands, not -1, to help_list.
+       * macrocmd.c (macro_command): Pass all_commands, not -1, to
+       help_list.
+       * language.c (set_check): Pass all_commands, not -1, to help_list.
+       * infcmd.c (unset_command): Pass all_commands, not -1, to
+       help_list.
+       * frame.c (set_backtrace_cmd): Pass all_commands, not -1, to
+       help_list.
+       * dwarf2read.c (set_dwarf2_cmd): Pass all_commands, not -1, to
+       help_list.
+       * dcache.c (set_dcache_command): Pass all_commands, not -1, to
+       help_list.
+       * breakpoint.c (save_command): Pass all_commands, not -1, to
+       help_list.
+       * ada-lang.c (maint_set_ada_cmd, set_ada_command): Pass
+       all_commands, not -1, to help_list.
+
 2014-06-12  Pierre Langlois  <pierre.langlois@embecosm.com>
 
        * regcache.c (struct register_to_invalidate): New structure.
index d7c7e24..56b3708 100644 (file)
@@ -357,7 +357,8 @@ static struct cmd_list_element *maint_show_ada_cmdlist;
 static void
 maint_set_ada_cmd (char *args, int from_tty)
 {
-  help_list (maint_set_ada_cmdlist, "maintenance set ada ", -1, gdb_stdout);
+  help_list (maint_set_ada_cmdlist, "maintenance set ada ", all_commands,
+            gdb_stdout);
 }
 
 /* Implement the "maintenance show ada" (prefix) command.  */
@@ -13517,7 +13518,7 @@ set_ada_command (char *arg, int from_tty)
 {
   printf_unfiltered (_(\
 "\"set ada\" must be followed by the name of a setting.\n"));
-  help_list (set_ada_list, "set ada ", -1, gdb_stdout);
+  help_list (set_ada_list, "set ada ", all_commands, gdb_stdout);
 }
 
 /* Implement the "show ada" prefix command.  */
index 23c8895..8f702e2 100644 (file)
@@ -16093,7 +16093,7 @@ save_command (char *arg, int from_tty)
 {
   printf_unfiltered (_("\"save\" must be followed by "
                       "the name of a save subcommand.\n"));
-  help_list (save_cmdlist, "save ", -1, gdb_stdout);
+  help_list (save_cmdlist, "save ", all_commands, gdb_stdout);
 }
 
 struct breakpoint *
index e5d34a7..a4f52f8 100644 (file)
@@ -218,7 +218,7 @@ info_command (char *arg, int from_tty)
 {
   printf_unfiltered (_("\"info\" must be followed by "
                       "the name of an info command.\n"));
-  help_list (infolist, "info ", -1, gdb_stdout);
+  help_list (infolist, "info ", all_commands, gdb_stdout);
 }
 
 /* The "show" command with no arguments shows all the settings.  */
@@ -1567,7 +1567,7 @@ set_debug (char *arg, int from_tty)
 {
   printf_unfiltered (_("\"set debug\" must be followed by "
                       "the name of a debug subcommand.\n"));
-  help_list (setdebuglist, "set debug ", -1, gdb_stdout);
+  help_list (setdebuglist, "set debug ", all_commands, gdb_stdout);
 }
 
 static void
index 005e207..aec732e 100644 (file)
@@ -160,14 +160,14 @@ static void
 dump_command (char *cmd, int from_tty)
 {
   printf_unfiltered (_("\"dump\" must be followed by a subcommand.\n\n"));
-  help_list (dump_cmdlist, "dump ", -1, gdb_stdout);
+  help_list (dump_cmdlist, "dump ", all_commands, gdb_stdout);
 }
 
 static void
 append_command (char *cmd, int from_tty)
 {
   printf_unfiltered (_("\"append\" must be followed by a subcommand.\n\n"));
-  help_list (dump_cmdlist, "append ", -1, gdb_stdout);
+  help_list (dump_cmdlist, "append ", all_commands, gdb_stdout);
 }
 
 static void
@@ -626,35 +626,36 @@ static void
 srec_dump_command (char *cmd, int from_tty)
 {
   printf_unfiltered ("\"dump srec\" must be followed by a subcommand.\n");
-  help_list (srec_cmdlist, "dump srec ", -1, gdb_stdout);
+  help_list (srec_cmdlist, "dump srec ", all_commands, gdb_stdout);
 }
 
 static void
 ihex_dump_command (char *cmd, int from_tty)
 {
   printf_unfiltered ("\"dump ihex\" must be followed by a subcommand.\n");
-  help_list (ihex_cmdlist, "dump ihex ", -1, gdb_stdout);
+  help_list (ihex_cmdlist, "dump ihex ", all_commands, gdb_stdout);
 }
 
 static void
 tekhex_dump_command (char *cmd, int from_tty)
 {
   printf_unfiltered ("\"dump tekhex\" must be followed by a subcommand.\n");
-  help_list (tekhex_cmdlist, "dump tekhex ", -1, gdb_stdout);
+  help_list (tekhex_cmdlist, "dump tekhex ", all_commands, gdb_stdout);
 }
 
 static void
 binary_dump_command (char *cmd, int from_tty)
 {
   printf_unfiltered ("\"dump binary\" must be followed by a subcommand.\n");
-  help_list (binary_dump_cmdlist, "dump binary ", -1, gdb_stdout);
+  help_list (binary_dump_cmdlist, "dump binary ", all_commands, gdb_stdout);
 }
 
 static void
 binary_append_command (char *cmd, int from_tty)
 {
   printf_unfiltered ("\"append binary\" must be followed by a subcommand.\n");
-  help_list (binary_append_cmdlist, "append binary ", -1, gdb_stdout);
+  help_list (binary_append_cmdlist, "append binary ", all_commands,
+            gdb_stdout);
 }
 
 extern initialize_file_ftype _initialize_cli_dump; /* -Wmissing-prototypes */
index 2379b54..350451a 100644 (file)
@@ -1499,7 +1499,7 @@ maint_cplus_command (char *arg, int from_tty)
                       "by the name of a command.\n"));
   help_list (maint_cplus_cmd_list,
             "maintenance cplus ",
-            -1, gdb_stdout);
+            all_commands, gdb_stdout);
 }
 
 /* This is a front end for cp_find_first_component, for unit testing.
index 9780f4d..6bf0e91 100644 (file)
@@ -681,7 +681,7 @@ set_dcache_command (char *arg, int from_tty)
 {
   printf_unfiltered (
      "\"set dcache\" must be followed by the name of a subcommand.\n");
-  help_list (dcache_set_list, "set dcache ", -1, gdb_stdout);
+  help_list (dcache_set_list, "set dcache ", all_commands, gdb_stdout);
 }
 
 static void
index f078cb4..3e441dc 100644 (file)
@@ -21811,7 +21811,8 @@ static struct cmd_list_element *show_dwarf2_cmdlist;
 static void
 set_dwarf2_cmd (char *args, int from_tty)
 {
-  help_list (set_dwarf2_cmdlist, "maintenance set dwarf2 ", -1, gdb_stdout);
+  help_list (set_dwarf2_cmdlist, "maintenance set dwarf2 ", all_commands,
+            gdb_stdout);
 }
 
 static void
index 8dea9c4..4f3cb35 100644 (file)
@@ -2707,7 +2707,8 @@ static struct cmd_list_element *show_backtrace_cmdlist;
 static void
 set_backtrace_cmd (char *args, int from_tty)
 {
-  help_list (set_backtrace_cmdlist, "set backtrace ", -1, gdb_stdout);
+  help_list (set_backtrace_cmdlist, "set backtrace ", all_commands,
+            gdb_stdout);
 }
 
 static void
index 167e717..05dba69 100644 (file)
@@ -462,7 +462,7 @@ info_guile_command (char *args, int from_tty)
 {
   printf_unfiltered (_("\"info guile\" must be followed"
                       " by the name of an info command.\n"));
-  help_list (info_guile_list, "info guile ", -1, gdb_stdout);
+  help_list (info_guile_list, "info guile ", all_commands, gdb_stdout);
 }
 \f
 /* Initialization.  */
index df4fd40..c4bb401 100644 (file)
@@ -2769,7 +2769,7 @@ unset_command (char *args, int from_tty)
 {
   printf_filtered (_("\"unset\" must be followed by the "
                     "name of an unset subcommand.\n"));
-  help_list (unsetlist, "unset ", -1, gdb_stdout);
+  help_list (unsetlist, "unset ", all_commands, gdb_stdout);
 }
 
 /* Implement `info proc' family of commands.  */
index d5502f2..1b65d65 100644 (file)
@@ -505,7 +505,7 @@ set_check (char *ignore, int from_tty)
 {
   printf_unfiltered (
      "\"set check\" must be followed by the name of a check subcommand.\n");
-  help_list (setchecklist, "set check ", -1, gdb_stdout);
+  help_list (setchecklist, "set check ", all_commands, gdb_stdout);
 }
 
 static void
index 0455fb0..94a627f 100644 (file)
@@ -38,7 +38,7 @@ macro_command (char *arg, int from_tty)
 {
   printf_unfiltered
     ("\"macro\" must be followed by the name of a macro command.\n");
-  help_list (macrolist, "macro ", -1, gdb_stdout);
+  help_list (macrolist, "macro ", all_commands, gdb_stdout);
 }
 
 
index 873c33c..30a9d3b 100644 (file)
@@ -88,7 +88,7 @@ maintenance_command (char *args, int from_tty)
 {
   printf_unfiltered (_("\"maintenance\" must be followed by "
                       "the name of a maintenance command.\n"));
-  help_list (maintenancelist, "maintenance ", -1, gdb_stdout);
+  help_list (maintenancelist, "maintenance ", all_commands, gdb_stdout);
 }
 
 #ifndef _WIN32
@@ -192,7 +192,8 @@ maintenance_info_command (char *arg, int from_tty)
 {
   printf_unfiltered (_("\"maintenance info\" must be followed "
                       "by the name of an info command.\n"));
-  help_list (maintenanceinfolist, "maintenance info ", -1, gdb_stdout);
+  help_list (maintenanceinfolist, "maintenance info ", all_commands,
+            gdb_stdout);
 }
 
 /* Mini tokenizing lexer for 'maint info sections' command.  */
@@ -439,7 +440,8 @@ maintenance_print_command (char *arg, int from_tty)
 {
   printf_unfiltered (_("\"maintenance print\" must be followed "
                       "by the name of a print command.\n"));
-  help_list (maintenanceprintlist, "maintenance print ", -1, gdb_stdout);
+  help_list (maintenanceprintlist, "maintenance print ", all_commands,
+            gdb_stdout);
 }
 
 /* The "maintenance translate-address" command converts a section and address
@@ -664,7 +666,8 @@ maintenance_set_cmd (char *args, int from_tty)
 {
   printf_unfiltered (_("\"maintenance set\" must be followed "
                       "by the name of a set command.\n"));
-  help_list (maintenance_set_cmdlist, "maintenance set ", -1, gdb_stdout);
+  help_list (maintenance_set_cmdlist, "maintenance set ", all_commands,
+            gdb_stdout);
 }
 
 static void
index 01b5d81..060d5ce 100644 (file)
@@ -394,7 +394,7 @@ set_ravenscar_command (char *arg, int from_tty)
 {
   printf_unfiltered (_(\
 "\"set ravenscar\" must be followed by the name of a setting.\n"));
-  help_list (set_ravenscar_list, "set ravenscar ", -1, gdb_stdout);
+  help_list (set_ravenscar_list, "set ravenscar ", all_commands, gdb_stdout);
 }
 
 /* Implement the "show ravenscar" prefix command.  */
index d5e5272..9db3410 100644 (file)
@@ -10249,7 +10249,7 @@ remote_delete_command (char *args, int from_tty)
 static void
 remote_command (char *args, int from_tty)
 {
-  help_list (remote_cmdlist, "remote ", -1, gdb_stdout);
+  help_list (remote_cmdlist, "remote ", all_commands, gdb_stdout);
 }
 
 static int
@@ -11601,7 +11601,7 @@ remote_async (struct target_ops *ops,
 static void
 set_remote_cmd (char *args, int from_tty)
 {
-  help_list (remote_set_cmdlist, "set remote ", -1, gdb_stdout);
+  help_list (remote_set_cmdlist, "set remote ", all_commands, gdb_stdout);
 }
 
 static void
index c288ab4..5600001 100644 (file)
@@ -363,13 +363,13 @@ ser_tcp_send_break (struct serial *scb)
 static void
 set_tcp_cmd (char *args, int from_tty)
 {
-  help_list (tcp_set_cmdlist, "set tcp ", -1, gdb_stdout);
+  help_list (tcp_set_cmdlist, "set tcp ", all_commands, gdb_stdout);
 }
 
 static void
 show_tcp_cmd (char *args, int from_tty)
 {
-  help_list (tcp_show_cmdlist, "show tcp ", -1, gdb_stdout);
+  help_list (tcp_show_cmdlist, "show tcp ", all_commands, gdb_stdout);
 }
 
 #ifndef USE_WIN32API
index d443508..f7e0de5 100644 (file)
@@ -615,7 +615,7 @@ serial_set_cmd (char *args, int from_tty)
 {
   printf_unfiltered ("\"set serial\" must be followed "
                     "by the name of a command.\n");
-  help_list (serial_set_cmdlist, "set serial ", -1, gdb_stdout);
+  help_list (serial_set_cmdlist, "set serial ", all_commands, gdb_stdout);
 }
 
 static void
index 4fc3ca5..d251e4d 100644 (file)
@@ -2649,7 +2649,7 @@ info_spu_command (char *args, int from_tty)
 {
   printf_unfiltered (_("\"info spu\" must be followed by "
                       "the name of an SPU facility.\n"));
-  help_list (infospucmdlist, "info spu ", -1, gdb_stdout);
+  help_list (infospucmdlist, "info spu ", all_commands, gdb_stdout);
 }
 
 
index 7ad4a44..d94db48 100644 (file)
@@ -3487,7 +3487,7 @@ overlay_command (char *args, int from_tty)
 {
   printf_unfiltered
     ("\"overlay\" must be followed by the name of an overlay command.\n");
-  help_list (overlaylist, "overlay ", -1, gdb_stdout);
+  help_list (overlaylist, "overlay ", all_commands, gdb_stdout);
 }
 
 /* Target Overlays for the "Simplest" overlay manager:
index 953748b..6b3389a 100644 (file)
@@ -1550,7 +1550,7 @@ static struct cmd_list_element *tdesc_unset_cmdlist;
 static void
 set_tdesc_cmd (char *args, int from_tty)
 {
-  help_list (tdesc_set_cmdlist, "set tdesc ", -1, gdb_stdout);
+  help_list (tdesc_set_cmdlist, "set tdesc ", all_commands, gdb_stdout);
 }
 
 static void
@@ -1562,7 +1562,7 @@ show_tdesc_cmd (char *args, int from_tty)
 static void
 unset_tdesc_cmd (char *args, int from_tty)
 {
-  help_list (tdesc_unset_cmdlist, "unset tdesc ", -1, gdb_stdout);
+  help_list (tdesc_unset_cmdlist, "unset tdesc ", all_commands, gdb_stdout);
 }
 
 static void
index 3488813..a137db5 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1544,7 +1544,7 @@ set_history (char *args, int from_tty)
 {
   printf_unfiltered (_("\"set history\" must be followed "
                       "by the name of a history subcommand.\n"));
-  help_list (sethistlist, "set history ", -1, gdb_stdout);
+  help_list (sethistlist, "set history ", all_commands, gdb_stdout);
 }
 
 void
index 9a88e8b..2c53e05 100644 (file)
@@ -607,7 +607,7 @@ tui_reg_command (char *args, int from_tty)
 {
   printf_unfiltered (_("\"tui reg\" must be followed by the name of a "
                      "tui reg command.\n"));
-  help_list (tuireglist, "tui reg ", -1, gdb_stdout);
+  help_list (tuireglist, "tui reg ", all_commands, gdb_stdout);
 }
 
 /* Provide a prototype to silence -Wmissing-prototypes.  */
index 7ea0fec..a97704d 100644 (file)
@@ -333,7 +333,7 @@ tui_command (char *args, int from_tty)
 {
   printf_unfiltered (_("\"tui\" must be followed by the name of a "
                      "tui command.\n"));
-  help_list (tuilist, "tui ", -1, gdb_stdout);
+  help_list (tuilist, "tui ", all_commands, gdb_stdout);
 }
 
 struct cmd_list_element **
index b4ad431..026f3a2 100644 (file)
@@ -636,7 +636,7 @@ set_print_type (char *arg, int from_tty)
 {
   printf_unfiltered (
      "\"set print type\" must be followed by the name of a subcommand.\n");
-  help_list (setprintlist, "set print type ", -1, gdb_stdout);
+  help_list (setprintlist, "set print type ", all_commands, gdb_stdout);
 }
 
 static void
index f55b5db..8600b34 100644 (file)
@@ -2704,7 +2704,7 @@ set_print (char *arg, int from_tty)
 {
   printf_unfiltered (
      "\"set print\" must be followed by the name of a print subcommand.\n");
-  help_list (setprintlist, "set print ", -1, gdb_stdout);
+  help_list (setprintlist, "set print ", all_commands, gdb_stdout);
 }
 
 static void
@@ -2718,7 +2718,7 @@ set_print_raw (char *arg, int from_tty)
 {
   printf_unfiltered (
      "\"set print raw\" must be followed by the name of a \"print raw\" subcommand.\n");
-  help_list (setprintrawlist, "set print raw ", -1, gdb_stdout);
+  help_list (setprintrawlist, "set print raw ", all_commands, gdb_stdout);
 }
 
 static void