diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-14 15:38:49 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-17 14:01:26 -0400 |
commit | 3d0b35641081d0f57d32583093f3297ff39b7379 (patch) | |
tree | fc6be36e7ce048ed74ce4597e0d365b1be4623d3 /gdb/cli/cli-cmds.c | |
parent | 1be99b11f8d1a8fd4049fee1c0eeaef73b3e6d1d (diff) | |
download | gdb-3d0b35641081d0f57d32583093f3297ff39b7379.zip gdb-3d0b35641081d0f57d32583093f3297ff39b7379.tar.gz gdb-3d0b35641081d0f57d32583093f3297ff39b7379.tar.bz2 |
gdb: add cmd_list_element::is_prefix
Same idea as the previous patch, but for prefix instead of alias.
gdb/ChangeLog:
* cli/cli-decode.h (cmd_list_element) <is_prefix>: New, use it.
Change-Id: I76a9d2e82fc8d7429904424674d99ce6f9880e2b
Diffstat (limited to 'gdb/cli/cli-cmds.c')
-rw-r--r-- | gdb/cli/cli-cmds.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index c29e597..0bf418e 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->subcommands != NULL) + if (cli_user_command_p (c) || c->is_prefix ()) 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->subcommands != NULL); + gdb_assert (c_command->is_prefix ()); c_alias = lookup_cmd_1 (& alias_prefix, cmdlist, NULL, NULL, 1); if (c_alias != c_command) error (_("ALIAS and COMMAND prefixes do not match.")); |