[Lldb-commits] [lldb] r180117 - Look for an inexact match in just the commands before searching the alias commands as well.

Kopec, Matt matt.kopec at intel.com
Tue Apr 23 12:05:21 PDT 2013


Sorry, I should have mentioned it in the commit message.

There was a failure in TestAliases.py where if you alias the command 'expr' twice, the second alias fails because the command interpreter failed to return the CommandSP for 'expr'. What actually happened is GetCommandSP returns a list of matches (2 in this case) if there is more than one match. So it would find 'expr' and the first alias for expr. I added a call to only return CommandSP for command (if one is found, since that is the one I want) and then search aliases after if nothing could be found.

Does that seem reasonable?

Thanks,
Matt

On 2013-04-23, at 2:53 PM, <jingham at apple.com>
 wrote:

> Matt,
> 
> What was this fixing?
> 
> Jim
> 
> On Apr 23, 2013, at 9:17 AM, Matt Kopec <Matt.Kopec at intel.com> wrote:
> 
>> Author: mkopec
>> Date: Tue Apr 23 11:17:32 2013
>> New Revision: 180117
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=180117&view=rev
>> Log:
>> Look for an inexact match in just the commands before searching the alias commands as well.
>> 
>> 
>> Modified:
>>   lldb/trunk/source/Interpreter/CommandInterpreter.cpp
>> 
>> Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=180117&r1=180116&r2=180117&view=diff
>> ==============================================================================
>> --- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
>> +++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Tue Apr 23 11:17:32 2013
>> @@ -848,10 +848,15 @@ CommandInterpreter::GetCommandObject (co
>>        command_obj = GetCommandSP (cmd_cstr, true, true, matches).get();
>>    }
>> 
>> -    // Finally, if there wasn't an exact match among the aliases, look for an inexact match
>> -    // in both the commands and the aliases.
>> +    // If there wasn't an exact match among the aliases, look for an inexact match
>> +    // in just the commands.
>> 
>>    if (command_obj == NULL)
>> +        command_obj = GetCommandSP(cmd_cstr, false, false, matches).get();
>> +
>> +    // Finally, if there wasn't an inexact match among the commands, look for an inexact
>> +    // match in both the commands and aliases.
>> +    if (command_obj == NULL)
>>        command_obj = GetCommandSP(cmd_cstr, true, false, matches).get();
>> 
>>    return command_obj;
>> 
>> 
>> _______________________________________________
>> lldb-commits mailing list
>> lldb-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
> 





More information about the lldb-commits mailing list