Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] fix for checking the command ambiguousness.
@ 2013-08-27  9:22 Muhammad Bilal
  2013-08-27 18:10 ` Pedro Alves
  0 siblings, 1 reply; 10+ messages in thread
From: Muhammad Bilal @ 2013-08-27  9:22 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-11-07 14:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-27  9:22 [patch] fix for checking the command ambiguousness Muhammad Bilal
2013-08-27 18:10 ` Pedro Alves
2013-08-28  8:16   ` Muhammad Bilal
     [not found]     ` <521DE287.2010208@redhat.com>
2013-08-28 14:17       ` Muhammad Bilal
2013-09-04 12:34         ` Muhammad Bilal
2013-09-10 10:33           ` Muhammad Bilal
2013-09-17 16:28             ` Muhammad Bilal
2013-09-17 16:31               ` Pedro Alves
2013-11-07 15:04                 ` Tom Tromey
2013-11-07 14:53         ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox