make calls to help_list use enumerator

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.
This commit is contained in:
Tom Tromey 2014-06-05 08:25:00 -06:00
parent f26c187e29
commit 635c7e8a05
26 changed files with 101 additions and 40 deletions

View 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.

View 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. */

View 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 *

View 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

View 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 */

View 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.

View 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

View 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

View 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

View 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);
}
/* Initialization. */

View 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. */

View 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

View 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);
}

View 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

View 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. */

View 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

View 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

View 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

View 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);
}

View 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:

View 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

View File

@ -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

View 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. */

View 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 **

View 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

View 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