[lldb-dev] [RFC] Listing files in remote directory
Raphael “Teemperor” Isemann via lldb-dev
lldb-dev at lists.llvm.org
Sun Jul 26 12:02:55 PDT 2020
I think classifying into local/platform isn't an issue (I think we always know if we're doing remote or local completion), but the bigger problem is that I'm not sure if we can easily list files/subdirs in a remote directory. I didn't find any existing functionality that's doing this, so I guess that would require to implement this functionality from scratch. And the problem with that is that I'm not even sure which underlying protocols support this functionality (without complicated workarounds at least), so that seems quite a lot of work.
> On 24 Jul 2020, at 20:50, Greg Clayton via lldb-dev <lldb-dev at lists.llvm.org> wrote:
>> On Jul 24, 2020, at 9:55 AM, GongYu Deng via lldb-dev <lldb-dev at lists.llvm.org <mailto:lldb-dev at lists.llvm.org>> wrote:
>> Hello everyone,
>> To implement a remote disk file completion like CommandCompletions:DiskFilesOrDirectories for commands like "platform get-size”, I was trying to find out how local disk files are resolved. It seems the resolving mechanism is based on the llvm::sys module with which the implementation of CommandCompletions:DiskFilesOrDirectories is indirectly coupled.
>> As I went through the DoExecute function of platform commands, it seems the remote context can be accessed by the Platform pointer returned from CommandObject::GetDebugger().GetPlatformList().GetSelectedPlatform(). So maybe we could refactor CommandCompletions:DiskFilesOrDirectories into Platform:: DiskFilesOrDirectories to make it available for remote resolving?
>> But I don’t know if the idea above is right or feasible. Or maybe there could be other better solutions.
>> Does anyone have ideas?
> That can be tricky, but it can be made to work. The main issue we have to worry about is sometimes file completion will want to be local, and sometimes we will want to use the platform. For example the "target create" command probably wants to use local paths, and other commands might want the platform. It would be interesting to see all of the places this completion is used and see if we can easily classify them into local or platform, or some might want both?
> It would be easy to move the llvm::sys file system calls into the host platform code if we were to make this happen.
>> Best regards,
>> Gongyu Deng
>> lldb-dev mailing list
>> lldb-dev at lists.llvm.org <mailto:lldb-dev at lists.llvm.org>
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev <https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev>
> lldb-dev mailing list
> lldb-dev at lists.llvm.org <mailto:lldb-dev at lists.llvm.org>
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev <https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lldb-dev