aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-05-17 14:01:32 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-05-17 14:01:32 -0400
commit034dce7a47652cf0a5f8fbcc403ca995171cc417 (patch)
tree7e0e13041428cac10deee758fbd2883dc0ce928b /gdb/top.c
parent3d0b35641081d0f57d32583093f3297ff39b7379 (diff)
downloadgdb-034dce7a47652cf0a5f8fbcc403ca995171cc417.zip
gdb-034dce7a47652cf0a5f8fbcc403ca995171cc417.tar.gz
gdb-034dce7a47652cf0a5f8fbcc403ca995171cc417.tar.bz2
gdb: add cmd_list_element::is_command_class_help
Same idea as the previous patches, but for whether a command is a "command class help" command. I think this one is particularly useful, because it's not obvious when reading code what "c->func == NULL" means. Remove the cmd_func_p function, which does kind of the same thing as cmd_list_element::is_command_class_help (except it doesn't give a clue about the semantic of a NULL func value). gdb/ChangeLog: * cli/cli-decode.h (cmd_list_element) <is_command_class_help>: New, use it. * command.h (cmd_func_p): Remove. * cli/cli-decode.c (cmd_func_p): Remove. Change-Id: I521a3e1896dc93a5babe1493d18f5eb071e1b3b7
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/top.c b/gdb/top.c
index a1a932a..b963536 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -666,7 +666,7 @@ execute_command (const char *p, int from_tty)
do_set_command (arg, from_tty, c);
else if (c->type == show_cmd)
do_show_command (arg, from_tty, c);
- else if (!cmd_func_p (c))
+ else if (c->is_command_class_help ())
error (_("That is not a command, just a help topic."));
else if (deprecated_call_command_hook)
deprecated_call_command_hook (c, arg, from_tty);