This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] fix for checking the command ambiguousness.
- From: Muhammad Bilal <mbilal at codesourcery dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 27 Aug 2013 14:22:37 +0500
- Subject: [patch] fix for checking the command ambiguousness.
- Authentication-results: sourceware.org; auth=none
Hi,
While I was looking the code of 'lookup_cmd_composition' function, I saw
there incorrect command ambiguousness checking.
Actually 'find_cmd' function does not return the CMD_LIST_AMBIGUOUS
macro, whereas 'lookup_cmd_1' function return this macro on the bases
of 'nfound'
variable and 'nfound' variable determines the command ambiguousness.
So, checking the command ambiguousness condition with 'nfound' variables
fixes the bug.
gdb/cli/cli-decode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
2013-07-27 Muhammad Bilal <mbilal@codesourcery.com>
* cli/cli-decode.c (lookup_cmd_composition): Check command
ambiguousness
with 'nfound' instead of CMD_LIST_AMBIGOUS.
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 2fdd9e4..30000d8 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -1729,7 +1729,7 @@ lookup_cmd_composition (const char *text,
*cmd = find_cmd (command, len, cur_list, 1, &nfound);
}
- if (*cmd == CMD_LIST_AMBIGUOUS)
+ if (nfound > 1)
{
return 0; /* ambiguous */
}
OK?
Thanks,
-Bilal