mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-18 05:12:33 +08:00
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
This commit is contained in:
@ -79,6 +79,10 @@ struct cmd_list_element
|
||||
For non-prefix commands, return an empty string. */
|
||||
std::string prefixname () const;
|
||||
|
||||
/* Return true if this command is an alias of another command. */
|
||||
bool is_alias () const
|
||||
{ return this->alias_target != nullptr; }
|
||||
|
||||
/* Points to next command in this list. */
|
||||
struct cmd_list_element *next = nullptr;
|
||||
|
||||
|
Reference in New Issue
Block a user