aboutsummaryrefslogtreecommitdiff
path: root/gdb/unittests
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-05-17 14:01:08 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-05-17 14:01:08 -0400
commit14b42fc4a0edc412e02a6c9cfe7eb48e67da3145 (patch)
tree21dc1064114f57a24740462b0f30a2c5ca581635 /gdb/unittests
parentecd0a6b35d32aa6aca913e2d0348cfdf7e78d6c3 (diff)
downloadbinutils-14b42fc4a0edc412e02a6c9cfe7eb48e67da3145.zip
binutils-14b42fc4a0edc412e02a6c9cfe7eb48e67da3145.tar.gz
binutils-14b42fc4a0edc412e02a6c9cfe7eb48e67da3145.tar.bz2
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) <prefixlist>: Rename to... <subcommands>: ... this. * cli/cli-decode.c (lookup_cmd_for_prefixlist): Rename to... (lookup_cmd_with_subcommands): ... this. Change-Id: I150da10d03052c2420aa5b0dee41f422e2a97928
Diffstat (limited to 'gdb/unittests')
-rw-r--r--gdb/unittests/command-def-selftests.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/unittests/command-def-selftests.c b/gdb/unittests/command-def-selftests.c
index 040e22b..53e5626 100644
--- a/gdb/unittests/command-def-selftests.c
+++ b/gdb/unittests/command-def-selftests.c
@@ -83,11 +83,11 @@ check_doc (struct cmd_list_element *commandlist, const char *prefix)
/* Check if this command has subcommands and is not an
abbreviation. We skip checking subcommands of abbreviations
in order to avoid duplicates in the output. */
- if (c->prefixlist != NULL && !c->abbrev_flag)
+ if (c->subcommands != NULL && !c->abbrev_flag)
{
/* Recursively call ourselves on the subcommand list,
passing the right prefix in. */
- check_doc (*c->prefixlist, c->prefixname ().c_str ());
+ check_doc (*c->subcommands, c->prefixname ().c_str ());
}
}
}
@@ -155,11 +155,11 @@ traverse_command_structure (struct cmd_list_element **list,
{
/* If this command has subcommands and is not an alias,
traverse the subcommands. */
- if (c->prefixlist != NULL && c->cmd_pointer == nullptr)
+ if (c->subcommands != NULL && c->cmd_pointer == nullptr)
{
/* Recursively call ourselves on the subcommand list,
passing the right prefix in. */
- traverse_command_structure (c->prefixlist, c->prefixname ().c_str ());
+ traverse_command_structure (c->subcommands, c->prefixname ().c_str ());
}
if (prefixcmd != c->prefix
|| (prefixcmd == nullptr && *list != cmdlist))