aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandCompletions.cpp
diff options
context:
space:
mode:
authorGongyu Deng <gy_deng@icloud.com>2020-08-24 17:34:32 +0200
committerRaphael Isemann <teemperor@gmail.com>2020-08-24 17:55:54 +0200
commit3cd8d7b1727f06a701f41764c1109e5d321284b3 (patch)
tree7cc5db64858ab24d7fd34ac997885465999425ff /lldb/source/Commands/CommandCompletions.cpp
parent19311f5c3e9ada9d445e49feb7a2ae00ddaee2fa (diff)
downloadllvm-3cd8d7b1727f06a701f41764c1109e5d321284b3.zip
llvm-3cd8d7b1727f06a701f41764c1109e5d321284b3.tar.gz
llvm-3cd8d7b1727f06a701f41764c1109e5d321284b3.tar.bz2
[lldb] Remote disk file/directory completion for platform commands
1. Extended the gdb-remote communication related classes with disk file/directory completion functions; 2. Added two common completion functions RemoteDiskFiles and RemoteDiskDirectories based on the functions above; 3. Added completion for these commands: A. platform get-file <remote-file> <local-file>; B. platform put-file <local-file> <remote-file>; C. platform get-size <remote-file>; D. platform settings -w <remote-dir>; E. platform open file <remote-file>. 4. Added related tests for client and server; 5. Updated docs/lldb-platform-packets.txt. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D85284
Diffstat (limited to 'lldb/source/Commands/CommandCompletions.cpp')
-rw-r--r--lldb/source/Commands/CommandCompletions.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp
index 9e74d8a..9221830 100644
--- a/lldb/source/Commands/CommandCompletions.cpp
+++ b/lldb/source/Commands/CommandCompletions.cpp
@@ -73,6 +73,8 @@ bool CommandCompletions::InvokeCommonCompletionCallbacks(
{eBreakpointNameCompletion, CommandCompletions::BreakpointNames},
{eProcessIDCompletion, CommandCompletions::ProcessIDs},
{eProcessNameCompletion, CommandCompletions::ProcessNames},
+ {eRemoteDiskFileCompletion, CommandCompletions::RemoteDiskFiles},
+ {eRemoteDiskDirectoryCompletion, CommandCompletions::RemoteDiskDirectories},
{eNoCompletion, nullptr} // This one has to be last in the list.
};
@@ -486,6 +488,24 @@ void CommandCompletions::DiskDirectories(const llvm::Twine &partial_file_name,
DiskFilesOrDirectories(partial_file_name, true, matches, Resolver);
}
+void CommandCompletions::RemoteDiskFiles(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher) {
+ lldb::PlatformSP platform_sp =
+ interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform();
+ if (platform_sp)
+ platform_sp->AutoCompleteDiskFileOrDirectory(request, false);
+}
+
+void CommandCompletions::RemoteDiskDirectories(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher) {
+ lldb::PlatformSP platform_sp =
+ interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform();
+ if (platform_sp)
+ platform_sp->AutoCompleteDiskFileOrDirectory(request, true);
+}
+
void CommandCompletions::Modules(CommandInterpreter &interpreter,
CompletionRequest &request,
SearchFilter *searcher) {