diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-17 14:01:20 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-17 14:01:20 -0400 |
commit | 1be99b11f8d1a8fd4049fee1c0eeaef73b3e6d1d (patch) | |
tree | 01897c887dc34c9be242b85d95adce5a5787a96e /gdb/unittests | |
parent | 9985872497e2b8c86424fcb97cd9a065f406a5c5 (diff) | |
download | gdb-1be99b11f8d1a8fd4049fee1c0eeaef73b3e6d1d.zip gdb-1be99b11f8d1a8fd4049fee1c0eeaef73b3e6d1d.tar.gz gdb-1be99b11f8d1a8fd4049fee1c0eeaef73b3e6d1d.tar.bz2 |
gdb: add cmd_list_element::is_alias
Add the cmd_list_element::is_alias helper to check whether a command is
an alias. I find it easier to understand the intention in:
if (c->is_alias ())
than
if (c->alias_target != nullptr)
Change all the spots that are reading alias_target just to compare it to
NULL/nullptr to use is_alias instead.
gdb/ChangeLog:
* cli/cli-decode.h (cmd_list_element) <is_alias>: New, use it.
Change-Id: I26ed56f99ee47fe884fdfedf87016501631693ce
Diffstat (limited to 'gdb/unittests')
-rw-r--r-- | gdb/unittests/command-def-selftests.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/unittests/command-def-selftests.c b/gdb/unittests/command-def-selftests.c index 123667d..4a6b678 100644 --- a/gdb/unittests/command-def-selftests.c +++ b/gdb/unittests/command-def-selftests.c @@ -155,7 +155,7 @@ traverse_command_structure (struct cmd_list_element **list, { /* If this command has subcommands and is not an alias, traverse the subcommands. */ - if (c->subcommands != NULL && c->alias_target == nullptr) + if (c->subcommands != NULL && !c->is_alias ()) { /* Recursively call ourselves on the subcommand list, passing the right prefix in. */ |