This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 2/2] * cli/cli-decode.c (apropos_cmd): Skip traversing abbreviations for prefix commands to avoid duplicates in the output.
- From: Samuel Bronson <naesten at gmail dot com>
- To: gdb-patches at sourceware dot org
- Cc: Samuel Bronson <naesten at gmail dot com>
- Date: Tue, 16 Jun 2009 23:30:05 -0400
- Subject: [PATCH 2/2] * cli/cli-decode.c (apropos_cmd): Skip traversing abbreviations for prefix commands to avoid duplicates in the output.
- References: <1245209405-9539-1-git-send-email-naesten@gmail.com>
Signed-off-by: Samuel Bronson <naesten@gmail.com>
---
gdb/cli/cli-decode.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index e2647fc..73c06bc 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -789,8 +789,11 @@ apropos_cmd (struct ui_file *stream, struct cmd_list_element *commandlist,
0 /* don't recurse */, stream);
}
}
- /* Check if this command has subcommands */
- if (c->prefixlist != NULL)
+ /* Check if this command has subcommands and is not an abbreviation.
+ We skip listing subcommands of abbreviations in order to avoid
+ duplicates in the output.
+ */
+ if (c->prefixlist != NULL && !c->abbrev_flag)
{
/* Recursively call ourselves on the subcommand list,
passing the right prefix in.
--
1.6.3.1