summaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-11-20 21:02:34 +0000
committerMike Frysinger <vapier@gentoo.org>2012-11-20 21:02:34 +0000
commit0e34fe6db3e848e1fc1fa7445ad1ab44dddd27f4 (patch)
tree4622c2e36240fb0ad7b02fdf441c27f45e48de10 /gdb/cli
parentd8701e7b61280ef03465ed12d3618cb45e77257f (diff)
downloadgdb-0e34fe6db3e848e1fc1fa7445ad1ab44dddd27f4.tar.gz
gdb: include help aliases in help command completion
There are a bunch of aliases that get used with help, but the current command completion logic does not include those when doing completions. Since the framework is already mostly in place, extend complete_on_cmdlist slightly to pass down the ignore_help_classes flag like is done with the existing lookup command logic. Now you can do: (gdb) help use<tab> and get back: (gdb) help user-defined Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-decode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 6e0f0dee477..3de01d58368 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -1726,7 +1726,8 @@ lookup_cmd_composition (char *text,
"oobar"; if WORD is "baz/foo", return "baz/foobar". */
VEC (char_ptr) *
-complete_on_cmdlist (struct cmd_list_element *list, char *text, char *word)
+complete_on_cmdlist (struct cmd_list_element *list, char *text, char *word,
+ int ignore_help_classes)
{
struct cmd_list_element *ptr;
VEC (char_ptr) *matchlist = NULL;
@@ -1743,7 +1744,7 @@ complete_on_cmdlist (struct cmd_list_element *list, char *text, char *word)
for (ptr = list; ptr; ptr = ptr->next)
if (!strncmp (ptr->name, text, textlen)
&& !ptr->abbrev_flag
- && (ptr->func
+ && (!ignore_help_classes || ptr->func
|| ptr->prefixlist))
{
char *match;