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]

Re: [RFA] candidates for ambiguous command in upper case


Luis Machado (lgustavo@codesourcery.com):

> >>So, what do we want to do?
> >>1. Remove the feature?
> >>2. Improve its consistency?
> >>3. Keep things as is?
> >>
> >
> >I vote #1.
> 
> I don't see a problem with #1 as long as we keep it consistent
> throughout from now on.

OK, I'm happy with #1 as well! New patch in attachment. OK to apply?

Thanks,
Jerome
commit d73d94c6d55e8cca5a38551207f65dfa2e47d054
Author: Jerome Guitton <guitton@adacore.com>
Date:   Fri Jan 27 17:06:32 2017 +0100

    Command names: make them case sensitive
    
    Case-insensitive search for command names is an obscure undocumented
    feature, which seems to be unused, is not tested and not quite
    consistent. Remove it.
    
    gdb/ChangeLog:
    
    	* cli-decode.c (lookup_cmd_1, lookup_cmd_composition):
    	Remove case-insensitive search.

diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 436a7ed..155d6d1 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -1378,19 +1378,6 @@ lookup_cmd_1 (const char **text, struct cmd_list_element *clist,
   nfound = 0;
   found = find_cmd (command, len, clist, ignore_help_classes, &nfound);
 
-  /* We didn't find the command in the entered case, so lower case it
-     and search again.  */
-  if (!found || nfound == 0)
-    {
-      for (tmp = 0; tmp < len; tmp++)
-	{
-	  char x = command[tmp];
-
-	  command[tmp] = isupper (x) ? tolower (x) : x;
-	}
-      found = find_cmd (command, len, clist, ignore_help_classes, &nfound);
-    }
-
   /* If nothing matches, we have a simple failure.  */
   if (nfound == 0)
     return 0;
@@ -1731,20 +1718,6 @@ lookup_cmd_composition (const char *text,
       nfound = 0;
       *cmd = find_cmd (command, len, cur_list, 1, &nfound);
       
-      /* We didn't find the command in the entered case, so lower case
-	 it and search again.
-      */
-      if (!*cmd || nfound == 0)
-	{
-	  for (tmp = 0; tmp < len; tmp++)
-	    {
-	      char x = command[tmp];
-
-	      command[tmp] = isupper (x) ? tolower (x) : x;
-	    }
-	  *cmd = find_cmd (command, len, cur_list, 1, &nfound);
-	}
-      
       if (*cmd == CMD_LIST_AMBIGUOUS)
 	{
 	  return 0;              /* ambiguous */

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