From 14b42fc4a0edc412e02a6c9cfe7eb48e67da3145 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 17 May 2021 14:01:08 -0400 Subject: gdb: rename cmd_list_element::prefixlist to subcommands While browsing this code, I found the name "prefixlist" really confusing. I kept reading it as "list of prefixes". Which it isn't: it's a list of sub-commands, for a prefix command. I think that renaming it to "subcommands" would make things clearer. gdb/ChangeLog: * Rename "prefixlist" parameters to "subcommands" throughout. * cli/cli-decode.h (cmd_list_element) : Rename to... : ... this. * cli/cli-decode.c (lookup_cmd_for_prefixlist): Rename to... (lookup_cmd_with_subcommands): ... this. Change-Id: I150da10d03052c2420aa5b0dee41f422e2a97928 --- gdb/cli/cli-cmds.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/cli/cli-cmds.c') diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 284b751..c29e597 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -1625,7 +1625,7 @@ show_user (const char *args, int from_tty) { for (c = cmdlist; c; c = c->next) { - if (cli_user_command_p (c) || c->prefixlist != NULL) + if (cli_user_command_p (c) || c->subcommands != NULL) show_user_1 (c, "", c->name, gdb_stdout); } } @@ -1900,7 +1900,7 @@ alias_command (const char *args, int from_tty) /* We've already tried to look up COMMAND. */ gdb_assert (c_command != NULL && c_command != (struct cmd_list_element *) -1); - gdb_assert (c_command->prefixlist != NULL); + gdb_assert (c_command->subcommands != NULL); c_alias = lookup_cmd_1 (& alias_prefix, cmdlist, NULL, NULL, 1); if (c_alias != c_command) error (_("ALIAS and COMMAND prefixes do not match.")); @@ -1909,7 +1909,7 @@ alias_command (const char *args, int from_tty) alias_cmd = add_alias_cmd (xstrdup (alias_argv[alias_argc - 1]), command_argv[command_argc - 1], class_alias, a_opts.abbrev_flag, - c_command->prefixlist); + c_command->subcommands); } gdb_assert (alias_cmd != nullptr); -- cgit v1.1