diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-17 14:01:08 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-17 14:01:08 -0400 |
commit | 14b42fc4a0edc412e02a6c9cfe7eb48e67da3145 (patch) | |
tree | 21dc1064114f57a24740462b0f30a2c5ca581635 /gdb/cli/cli-setshow.c | |
parent | ecd0a6b35d32aa6aca913e2d0348cfdf7e78d6c3 (diff) | |
download | binutils-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/cli/cli-setshow.c')
-rw-r--r-- | gdb/cli/cli-setshow.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index 35482e1..cb72c62 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -550,10 +550,10 @@ do_set_command (const char *arg, int from_tty, struct cmd_list_element *c) p = p->prefix; } - /* Don't trigger any observer notification if prefixlist is not + /* Don't trigger any observer notification if subcommands is not setlist. */ i--; - if (cmds[i]->prefixlist != &setlist) + if (cmds[i]->subcommands != &setlist) { xfree (cmds); xfree (name); @@ -740,7 +740,7 @@ cmd_show_list (struct cmd_list_element *list, int from_tty) /* If we find a prefix, run its list, prefixing our output by its prefix (with "show " skipped). */ - if (list->prefixlist && list->cmd_pointer == nullptr) + if (list->subcommands && list->cmd_pointer == nullptr) { ui_out_emit_tuple optionlist_emitter (uiout, "optionlist"); std::string prefixname = list->prefixname (); @@ -748,7 +748,7 @@ cmd_show_list (struct cmd_list_element *list, int from_tty) if (uiout->is_mi_like_p ()) uiout->field_string ("prefix", new_prefix); - cmd_show_list (*list->prefixlist, from_tty); + cmd_show_list (*list->subcommands, from_tty); } else if (list->theclass != no_set_class && list->cmd_pointer == nullptr) { @@ -758,7 +758,7 @@ cmd_show_list (struct cmd_list_element *list, int from_tty) { /* If we find a prefix, output it (with "show " skipped). */ std::string prefixname = list->prefix->prefixname (); - prefixname = (list->prefix->prefixlist == nullptr ? "" + prefixname = (list->prefix->subcommands == nullptr ? "" : strstr (prefixname.c_str (), "show ") + 5); uiout->text (prefixname.c_str ()); } |