From 8334d2bfd34e2666db173269525d17352afa7bac Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Thu, 8 Aug 2024 12:55:10 -0700 Subject: [lldb/Interpreter] Fix ambiguous partial command resolution (#101934) This patch is a follow-up to #97263 that fix ambigous abbreviated command resolution. When multiple commands are resolved, instead of failing to pick a command to run, this patch changes to resolution logic to check if there is a single alias match and if so, it will run the alias instead of the other matches. This has as a side-effect that we don't need to make aliases for every substring of aliases to support abbrivated alias resolution. Signed-off-by: Med Ismail Bennani --- lldb/source/Commands/CommandObjectCommands.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lldb/source/Commands/CommandObjectCommands.cpp') diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index c63445b7c8c8..7c439f4ddb93 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -322,7 +322,13 @@ rather than using a positional placeholder:" (lldb) command alias bl3 breakpoint set -f %1 -l 3 - Always sets a breakpoint on line 3 of whatever file is indicated.)"); + Always sets a breakpoint on line 3 of whatever file is indicated. + +)" + + "If the alias abbreviation or the full alias command collides with another \ +existing command, the command resolver will prefer to use the alias over any \ +other command as far as there is only one alias command match."); CommandArgumentEntry arg1; CommandArgumentEntry arg2; -- cgit v1.2.3