summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-09-23 08:16:19 +0000
committerRaphael Isemann <teemperor@gmail.com>2019-09-23 08:16:19 +0000
commitf8e733f14994cc739f11978d8d901426a3771cbc (patch)
tree692e7418ec97cfcb7e2fd7d1878c6602e5ab89f8 /lldb/source/Interpreter/CommandInterpreter.cpp
parentc063b0b0d3346d2a50e2ef28ec0147d6d53f399d (diff)
downloadbcm5719-llvm-f8e733f14994cc739f11978d8d901426a3771cbc.tar.gz
bcm5719-llvm-f8e733f14994cc739f11978d8d901426a3771cbc.zip
[lldb] Reduce some dangerous boilerplate with CompletionRequest::ShiftArguments
We should in general not allow external code to fiddle with the internals of CompletionRequest, but until this is gone let's at least provide a utility function that makes this less dangerous. This also now correct updates the partially parsed argument list, but it doesn't seem to be used by anything that is behind one of the current shift/SetCursorIndex calls, so this doesn't seeem to fix any currently used completion. llvm-svn: 372556
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index e9f22b5ebd2..c8a64b09526 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -1794,8 +1794,7 @@ void CommandInterpreter::HandleCompletionMatches(CompletionRequest &request) {
CommandObject *command_object =
GetCommandObject(request.GetParsedLine().GetArgumentAtIndex(0));
if (command_object) {
- request.GetParsedLine().Shift();
- request.SetCursorIndex(request.GetCursorIndex() - 1);
+ request.ShiftArguments();
command_object->HandleCompletion(request);
}
}
OpenPOWER on IntegriCloud