This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] fix for checking the command ambiguousness.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]