diff options
author | Glen McCready <gkm@pobox.com> | 2000-04-20 23:51:01 +0000 |
---|---|---|
committer | Glen McCready <gkm@pobox.com> | 2000-04-20 23:51:01 +0000 |
commit | 49a5a3a3e37d495246ffe43f53a41b80e7892ec3 (patch) | |
tree | 7d5dc72abbf4955bd2388ec72aa0e088735a05ce /gdb/command.c | |
parent | aa15f6f7b026e6966aab775a87b417c9903bfeb3 (diff) | |
download | gdb-49a5a3a3e37d495246ffe43f53a41b80e7892ec3.zip gdb-49a5a3a3e37d495246ffe43f53a41b80e7892ec3.tar.gz gdb-49a5a3a3e37d495246ffe43f53a41b80e7892ec3.tar.bz2 |
Fri Mar 24 12:10:38 2000 glen mccready <gkm@pobox.com>
* command.c, command.h (help_all): Add functionality to display
a complete listing of available commands.
Diffstat (limited to 'gdb/command.c')
-rw-r--r-- | gdb/command.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gdb/command.c b/gdb/command.c index 737ac77..279bc68 100644 --- a/gdb/command.c +++ b/gdb/command.c @@ -510,6 +510,12 @@ help_cmd (command, stream) return; } + if (strcmp (command, "all") == 0) + { + help_all (stream); + return; + } + c = lookup_cmd (&command, cmdlist, "", 0, 0); if (c == 0) @@ -602,6 +608,27 @@ Command name abbreviations are allowed if unambiguous.\n", cmdtype1, cmdtype2); } +static void +help_all (stream) + struct ui_file *stream; +{ + struct cmd_list_element *c; + extern struct cmd_list_element *cmdlist; + + for (c = cmdlist; c; c = c->next) + { + if (c->abbrev_flag) + continue; + /* If this is a prefix command, print it's subcommands */ + if (c->prefixlist) + help_cmd_list (*c->prefixlist, all_commands, c->prefixname, 0, stream); + + /* If this is a class name, print all of the commands in the class */ + else if (c->function.cfunc == NULL) + help_cmd_list (cmdlist, c->class, "", 0, stream); + } +} + /* Print only the first line of STR on STREAM. */ static void print_doc_line (stream, str) |