gdb: add cmd_list_element::is_alias
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 17 May 2021 18:01:20 +0000 (14:01 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Mon, 17 May 2021 18:01:20 +0000 (14:01 -0400)
commit1be99b11f8d1a8fd4049fee1c0eeaef73b3e6d1d
tree01897c887dc34c9be242b85d95adce5a5787a96e
parent9985872497e2b8c86424fcb97cd9a065f406a5c5
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
gdb/ChangeLog
gdb/cli/cli-decode.c
gdb/cli/cli-decode.h
gdb/cli/cli-setshow.c
gdb/unittests/command-def-selftests.c
This page took 0.02504 seconds and 4 git commands to generate.