[Lldb-commits] [PATCH] D143932: Further delay simulator SDK filepath discovery until needed
Jason Molenda via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Feb 13 10:52:34 PST 2023
jasonmolenda created this revision.
jasonmolenda added a reviewer: aprantl.
jasonmolenda added a project: LLDB.
Herald added a subscriber: JDevlieghere.
Herald added a project: All.
jasonmolenda requested review of this revision.
Herald added a subscriber: lldb-commits.
In https://reviews.llvm.org/D122373 I changed how the apple simulator platform plugins would find the SDK path given the name of an SDK -- so we would wait until we were actually Creating the plugin to call `xcrun` to find the full path. If a system doesn't have a given SDK installed, this xcrun call can be very slow, so delaying that search until we know we need a specific simulator platform to be selected, avoided that problem.
I have a new way of hitting this now, and need to make it even more lazy. `qProcessInfo` can give lldb a list of addresses of binaries to load -- and in the case of the kernel, the address is the address of a *kernelset*. We need some Mach-O fileset specific code to find the kernel in the fileset. So ProcessGDBRemote force-creates every platform, and asks it, "can you do something with this address that might be a fileset". PlatformDarwinKernel knows how to do something. But every platform is force-Created, so if the create is expensive (as it is with the simulator platforms), we have a big delay if some SDKs aren't installed on the system.
This patch moves the expansion of (primary sdk name, seconary sdk name) -> sdk filepath until it's actually used by the simulator platform methods -- much later than the CreateInstance, when the platform is actually being used. It will only be calculated once.
I'd call it a NFC change tbh, but it does avoid a very expensive external cost so it's not completely accurate. It's a big important for this use case.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D143932
Files:
lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143932.497046.patch
Type: text/x-patch
Size: 5109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230213/dec40a6e/attachment.bin>
More information about the lldb-commits
mailing list