summaryrefslogtreecommitdiff
path: root/gdb/maint-test-settings.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2019-07-03 13:34:19 +0100
committerPedro Alves <palves@redhat.com>2019-07-03 13:35:03 +0100
commitc6ac893109fdc2c3fce2b7457adccdc10f235354 (patch)
tree282c6ea2fc4c5420446df44349c1f326448acac2 /gdb/maint-test-settings.c
parentd1fcf2fded9a5a54d0714ae01b60ccb57e75b8b5 (diff)
downloadbinutils-gdb-c6ac893109fdc2c3fce2b7457adccdc10f235354.tar.gz
"maint test-settings set/show" -> "maint set/show test-settings"
This commit renames "maint test-settings set/show" to "maint set/show test-settings". This helps the following patch, which introduce a "maint with" command what works with all "maint set" settings. gdb/ChangeLog: 2019-07-03 Pedro Alves <palves@redhat.com> * NEWS (New commands): Mention "maint set/show test-settings" instead of "maint test-settings". * maint-test-settings.c (maintenance_test_settings_list): Delete. (maintenance_test_settings_set_list): Rename to ... (maintenance_set_test_settings_list): ... this. (maintenance_test_settings_show_list): Rename to ... (maintenance_show_test_settings_list): ... this. (maintenance_test_settings_cmd): Delete. (maintenance_test_settings_set_cmd): ... (maintenance_set_test_settings_cmd): ... this. (maintenance_test_settings_show_cmd): ... (maintenance_show_test_settings_cmd): ... this. (maintenance_test_settings_show_value_cmd): (maintenance_show_test_settings_value_cmd): ... this. (_initialize_maint_test_settings): No longer install the "maint test-settings" prefix command. Rename "maint test-settings set" to "maint set test-settings", and "maint test-settings show" to "maint show test-settings". Adjust all subcommands. gdb/doc/ChangeLog: 2019-07-03 Pedro Alves <palves@redhat.com> * gdb.texinfo (Maintenance Commands): Document "maint set/show test-settings" instead of "maint test-settings set/show". gdb/testsuite/ChangeLog: 2019-07-03 Pedro Alves <palves@redhat.com> * gdb.base/settings.exp: Replace all references to "maint test-settings set" with references to "maint set test-settings", and all references to "maint test-settings show" with references to "maint show test-settings".
Diffstat (limited to 'gdb/maint-test-settings.c')
-rw-r--r--gdb/maint-test-settings.c149
1 files changed, 64 insertions, 85 deletions
diff --git a/gdb/maint-test-settings.c b/gdb/maint-test-settings.c
index 5075ed1aac0..b549b8d39bf 100644
--- a/gdb/maint-test-settings.c
+++ b/gdb/maint-test-settings.c
@@ -21,46 +21,33 @@
#include "defs.h"
#include "gdbcmd.h"
-/* Command list for "maint test-settings". */
-static cmd_list_element *maintenance_test_settings_list;
+/* Command list for "maint set test-settings". */
+static cmd_list_element *maintenance_set_test_settings_list;
-/* Command list for "maint test-settings set/show". */
-static cmd_list_element *maintenance_test_settings_set_list;
-static cmd_list_element *maintenance_test_settings_show_list;
+/* Command list for "maint show test-settings". */
+static cmd_list_element *maintenance_show_test_settings_list;
-/* The "maintenance test-settings" prefix command. */
+/* The "maintenance set test-settings" prefix command. */
static void
-maintenance_test_settings_cmd (const char *arg, int from_tty)
+maintenance_set_test_settings_cmd (const char *args, int from_tty)
{
- printf_unfiltered
- (_("\"maintenance test-settings\" must be followed "
- "by the name of a subcommand.\n"));
- help_list (maintenance_test_settings_list, "maintenance test-settings ",
- all_commands, gdb_stdout);
-}
-
-/* The "maintenance test-settings set" prefix command. */
-
-static void
-maintenance_test_settings_set_cmd (const char *args, int from_tty)
-{
- printf_unfiltered (_("\"maintenance test-settings set\" must be followed "
+ printf_unfiltered (_("\"maintenance set test-settings\" must be followed "
"by the name of a set command.\n"));
- help_list (maintenance_test_settings_set_list,
- "maintenance test-settings set ",
+ help_list (maintenance_set_test_settings_list,
+ "maintenance set test-settings ",
all_commands, gdb_stdout);
}
-/* The "maintenance test-settings show" prefix command. */
+/* The "maintenance show test-settings" prefix command. */
static void
-maintenance_test_settings_show_cmd (const char *args, int from_tty)
+maintenance_show_test_settings_cmd (const char *args, int from_tty)
{
- cmd_show_list (maintenance_test_settings_show_list, from_tty, "");
+ cmd_show_list (maintenance_show_test_settings_list, from_tty, "");
}
-/* Control variables for all the "maintenance test-settings set/show
+/* Control variables for all the "maintenance set/show test-settings
xxx" commands. */
static int maintenance_test_settings_boolean;
@@ -85,7 +72,7 @@ static char *maintenance_test_settings_optional_filename;
static char *maintenance_test_settings_filename;
-/* Enum values for the "maintenance test-settings set/show boolean"
+/* Enum values for the "maintenance set/show test-settings boolean"
commands. */
static const char maintenance_test_settings_xxx[] = "xxx";
static const char maintenance_test_settings_yyy[] = "yyy";
@@ -101,10 +88,10 @@ static const char *const maintenance_test_settings_enums[] = {
static const char *maintenance_test_settings_enum
= maintenance_test_settings_xxx;
-/* The "maintenance test-settings show xxx" commands. */
+/* The "maintenance show test-settings xxx" commands. */
static void
-maintenance_test_settings_show_value_cmd
+maintenance_show_test_settings_value_cmd
(struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
@@ -117,29 +104,21 @@ _initialize_maint_test_settings (void)
{
maintenance_test_settings_filename = xstrdup ("/foo/bar");
- add_prefix_cmd ("test-settings", no_class,
- maintenance_test_settings_cmd,
- _("\
-Generic command for testing the settings infrastructure."),
- &maintenance_test_settings_list,
- "maintenance test-settings ", 0,
- &maintenancelist);
-
- add_prefix_cmd ("set", class_maintenance,
- maintenance_test_settings_set_cmd, _("\
+ add_prefix_cmd ("test-settings", class_maintenance,
+ maintenance_set_test_settings_cmd, _("\
Set GDB internal variables used for set/show command infrastructure testing."),
- &maintenance_test_settings_set_list,
- "maintenance test-settings set ",
+ &maintenance_set_test_settings_list,
+ "maintenance set test-settings ",
0/*allow-unknown*/,
- &maintenance_test_settings_list);
+ &maintenance_set_cmdlist);
- add_prefix_cmd ("show", class_maintenance,
- maintenance_test_settings_show_cmd, _("\
+ add_prefix_cmd ("test-settings", class_maintenance,
+ maintenance_show_test_settings_cmd, _("\
Show GDB internal variables used for set/show command infrastructure testing."),
- &maintenance_test_settings_show_list,
- "maintenance test-settings show ",
+ &maintenance_show_test_settings_list,
+ "maintenance show test-settings ",
0/*allow-unknown*/,
- &maintenance_test_settings_list);
+ &maintenance_show_cmdlist);
add_setshow_boolean_cmd ("boolean", class_maintenance,
&maintenance_test_settings_boolean, _("\
@@ -147,9 +126,9 @@ command used for internal testing"), _("\
command used for internal testing"),
nullptr, /* help_doc */
nullptr, /* set_cmd */
- maintenance_test_settings_show_value_cmd,
- &maintenance_test_settings_set_list,
- &maintenance_test_settings_show_list);
+ maintenance_show_test_settings_value_cmd,
+ &maintenance_set_test_settings_list,
+ &maintenance_show_test_settings_list);
add_setshow_auto_boolean_cmd ("auto-boolean", class_maintenance,
&maintenance_test_settings_auto_boolean, _("\
@@ -157,19 +136,19 @@ command used for internal testing"), _("\
command used for internal testing"),
nullptr, /* help_doc */
nullptr, /* set_cmd */
- maintenance_test_settings_show_value_cmd,
- &maintenance_test_settings_set_list,
- &maintenance_test_settings_show_list);
+ maintenance_show_test_settings_value_cmd,
+ &maintenance_set_test_settings_list,
+ &maintenance_show_test_settings_list);
add_setshow_uinteger_cmd ("uinteger", class_maintenance,
&maintenance_test_settings_uinteger, _("\
command used for internal testing"), _("\
command used for internal testing"),
- nullptr, /* help_doc */
- nullptr, /* set_cmd */
- maintenance_test_settings_show_value_cmd,
- &maintenance_test_settings_set_list,
- &maintenance_test_settings_show_list);
+ nullptr, /* help_doc */
+ nullptr, /* set_cmd */
+ maintenance_show_test_settings_value_cmd,
+ &maintenance_set_test_settings_list,
+ &maintenance_show_test_settings_list);
add_setshow_integer_cmd ("integer", class_maintenance,
&maintenance_test_settings_integer, _("\
@@ -177,9 +156,9 @@ command used for internal testing"), _("\
command used for internal testing"),
nullptr, /* help_doc */
nullptr, /* set_cmd */
- maintenance_test_settings_show_value_cmd,
- &maintenance_test_settings_set_list,
- &maintenance_test_settings_show_list);
+ maintenance_show_test_settings_value_cmd,
+ &maintenance_set_test_settings_list,
+ &maintenance_show_test_settings_list);
add_setshow_string_cmd ("string", class_maintenance,
&maintenance_test_settings_string, _("\
@@ -187,9 +166,9 @@ command used for internal testing"), _("\
command used for internal testing"),
nullptr, /* help_doc */
nullptr, /* set_cmd */
- maintenance_test_settings_show_value_cmd,
- &maintenance_test_settings_set_list,
- &maintenance_test_settings_show_list);
+ maintenance_show_test_settings_value_cmd,
+ &maintenance_set_test_settings_list,
+ &maintenance_show_test_settings_list);
add_setshow_string_noescape_cmd
("string-noescape", class_maintenance,
@@ -198,9 +177,9 @@ command used for internal testing"), _("\
command used for internal testing"),
nullptr, /* help_doc */
nullptr, /* set_cmd */
- maintenance_test_settings_show_value_cmd,
- &maintenance_test_settings_set_list,
- &maintenance_test_settings_show_list);
+ maintenance_show_test_settings_value_cmd,
+ &maintenance_set_test_settings_list,
+ &maintenance_show_test_settings_list);
add_setshow_optional_filename_cmd
("optional-filename", class_maintenance,
@@ -209,9 +188,9 @@ command used for internal testing"), _("\
command used for internal testing"),
nullptr, /* help_doc */
nullptr, /* set_cmd */
- maintenance_test_settings_show_value_cmd,
- &maintenance_test_settings_set_list,
- &maintenance_test_settings_show_list);
+ maintenance_show_test_settings_value_cmd,
+ &maintenance_set_test_settings_list,
+ &maintenance_show_test_settings_list);
add_setshow_filename_cmd ("filename", class_maintenance,
&maintenance_test_settings_filename, _("\
@@ -219,9 +198,9 @@ command used for internal testing"), _("\
command used for internal testing"),
nullptr, /* help_doc */
nullptr, /* set_cmd */
- maintenance_test_settings_show_value_cmd,
- &maintenance_test_settings_set_list,
- &maintenance_test_settings_show_list);
+ maintenance_show_test_settings_value_cmd,
+ &maintenance_set_test_settings_list,
+ &maintenance_show_test_settings_list);
add_setshow_zinteger_cmd ("zinteger", class_maintenance,
&maintenance_test_settings_zinteger, _("\
@@ -229,9 +208,9 @@ command used for internal testing"), _("\
command used for internal testing"),
nullptr, /* help_doc */
nullptr, /* set_cmd */
- maintenance_test_settings_show_value_cmd,
- &maintenance_test_settings_set_list,
- &maintenance_test_settings_show_list);
+ maintenance_show_test_settings_value_cmd,
+ &maintenance_set_test_settings_list,
+ &maintenance_show_test_settings_list);
add_setshow_zuinteger_cmd ("zuinteger", class_maintenance,
&maintenance_test_settings_zuinteger, _("\
@@ -239,9 +218,9 @@ command used for internal testing"), _("\
command used for internal testing"),
nullptr, /* help_doc */
nullptr, /* set_cmd */
- maintenance_test_settings_show_value_cmd,
- &maintenance_test_settings_set_list,
- &maintenance_test_settings_show_list);
+ maintenance_show_test_settings_value_cmd,
+ &maintenance_set_test_settings_list,
+ &maintenance_show_test_settings_list);
add_setshow_zuinteger_unlimited_cmd
("zuinteger-unlimited", class_maintenance,
@@ -250,9 +229,9 @@ command used for internal testing"), _("\
command used for internal testing"),
nullptr, /* help_doc */
nullptr, /* set_cmd */
- maintenance_test_settings_show_value_cmd,
- &maintenance_test_settings_set_list,
- &maintenance_test_settings_show_list);
+ maintenance_show_test_settings_value_cmd,
+ &maintenance_set_test_settings_list,
+ &maintenance_show_test_settings_list);
add_setshow_enum_cmd ("enum", class_maintenance,
maintenance_test_settings_enums,
@@ -261,7 +240,7 @@ command used for internal testing"), _("\
command used for internal testing"),
nullptr, /* help_doc */
nullptr, /* set_cmd */
- maintenance_test_settings_show_value_cmd,
- &maintenance_test_settings_set_list,
- &maintenance_test_settings_show_list);
+ maintenance_show_test_settings_value_cmd,
+ &maintenance_set_test_settings_list,
+ &maintenance_show_test_settings_list);
}