[lldb-dev] Module Cache improvements - RFC
Greg Clayton via lldb-dev
lldb-dev at lists.llvm.org
Tue Feb 23 13:23:27 PST 2016
> On Feb 23, 2016, at 10:31 AM, Nico Weber <thakis at chromium.org> wrote:
>
> On Tue, Feb 23, 2016 at 1:21 PM, Tamas Berghammer via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> Yes we already have a disk cache on the host. I agree with you that waiting 30s at the first startup shouldn't be an issue in general (Pavel isn't sharing my opinion). The only catch is that in case of iOS there are only a few different builds released so if you downloaded the modules once then I think you won't have to download them the next time when you try to use a different device. In case of Android we have to download the symbols from each device you are using and at that point 30s might be an issue (I still don't think it is).
>
> With my app developer hat on, if some program makes me wait 30s for something then I won't like that program.
I agree, but if the first time you hook your phone up Android Studio pops up a dialog box saying "This is the first time you have connected this device, hold on while I cache the shared libraries for this device..." then it wouldn't be too bad. It is primarily the fact that the 30 seconds is happening without feedback during first launch or attach. Also, you can probably use something faster than the lldb-platform to download all of the files. In Xcode, we download all symbols into the users home directory in a known location:
~/Library/Developer/Xcode/iOS DeviceSupport
This folder contains the exact OS version and a build number:
(lldb) platform select remote-ios
Platform: remote-ios
Connected: no
SDK Roots: [ 0] "~/Library/Developer/Xcode/iOS DeviceSupport/9.0 (WWWWW)"
SDK Roots: [ 1] "~/Library/Developer/Xcode/iOS DeviceSupport/9.1 (XXXXX)"
SDK Roots: [ 2] "~/Library/Developer/Xcode/iOS DeviceSupport/9.2 (YYYYY)"
Where WWWWW, XXXXX, YYYYY are build numbers. We know we can look in these folders for any files that are from the device. They get populated and these SDK directories get searched by LLDB's PlatformRemoteiOS so they get found (we don't use the file cache that the PlatformAndroid currently uses).
So with a little work, I would add some functionality to your Android Studio, have something that knows how to copy files from device as quickly as possible (using lldb-platform is sloooowww and that is the way it is currently done I believe) into some such directory, all while showing a progress dialog to the user on first device connect, and then debugging will always be quick. And you can probably make it quicker than 30 seconds.
Greg Clayton
More information about the lldb-dev
mailing list