From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2962 invoked by alias); 27 Aug 2013 09:22:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 2952 invoked by uid 89); 27 Aug 2013 09:22:54 -0000 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Aug 2013 09:22:54 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RDNS_NONE,SPF_HELO_FAIL autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1VEFUA-00034V-2I from Muhammad_Bilal@mentor.com for gdb-patches@sourceware.org; Tue, 27 Aug 2013 02:22:50 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 27 Aug 2013 02:22:50 -0700 Received: from [137.202.157.37] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.2.247.3; Tue, 27 Aug 2013 10:22:48 +0100 Message-ID: <521C6FDD.3090909@codesourcery.com> Date: Tue, 27 Aug 2013 09:22:00 -0000 From: Muhammad Bilal User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: "gdb-patches@sourceware.org" Subject: [patch] fix for checking the command ambiguousness. Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-08/txt/msg00773.txt.bz2 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 * 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