diff options
author | Eike Ziller <[email protected]> | 2020-07-08 16:14:40 +0200 |
---|---|---|
committer | Eike Ziller <[email protected]> | 2020-07-13 11:55:33 +0000 |
commit | 72bf4cd15fa9bf6842cfd1ea08dad142b3690f92 (patch) | |
tree | f2e1ef36e64e34dd089d4b6108a1b4c55b084c83 /src/plugins/ios/iosrunner.cpp | |
parent | bc517e6d928af1ad5a01e41fb3dec78a2e6dfeb4 (diff) |
iOS: Fix slow debugger startup on devices
We need to pass the path to the device symbols, that Xcode downloaded
for the device's OS version, as the sysroot to the debugger. Otherwise
debugger startup is very slow.
We already tried to do that, but it looks like, depending on the
devices, this path can contain an architecture specific part, e.g.
"iOS DeviceSupport/13.5.1 (17F80) arm64e" instead of just "iOS
DeviceSupport/13.5.1 (17F80)". It can still be just the latter, so we
get the devices architecture information, try the architecture specific
directory first, and fall back to the architecture agnostic name as
before if the former doesn't exist.
Fixes: QTCREATORBUG-21682
Change-Id: I2efdbfda0282f1cf0f8d10bd4e5217a298027fcf
Reviewed-by: hjk <[email protected]>
Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src/plugins/ios/iosrunner.cpp')
-rw-r--r-- | src/plugins/ios/iosrunner.cpp | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index 1aa5fc52331..61501f9d752 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -436,28 +436,26 @@ void IosDebugSupport::start() IosDevice::ConstPtr dev = device().dynamicCast<const IosDevice>(); setStartMode(AttachToRemoteProcess); setIosPlatform("remote-ios"); - QString osVersion = dev->osVersion(); - FilePath deviceSdk1 = FilePath::fromString(QDir::homePath() - + "/Library/Developer/Xcode/iOS DeviceSupport/" - + osVersion + "/Symbols"); - QString deviceSdk; - if (deviceSdk1.isDir()) { - deviceSdk = deviceSdk1.toString(); - } else { - const FilePath deviceSdk2 = IosConfigurations::developerPath() - .pathAppended("Platforms/iPhoneOS.platform/DeviceSupport/" - + osVersion + "/Symbols"); - if (deviceSdk2.isDir()) { - deviceSdk = deviceSdk2.toString(); - } else { - TaskHub::addTask(DeploymentTask(Task::Warning, tr( - "Could not find device specific debug symbols at %1. " - "Debugging initialization will be slow until you open the Organizer window of " - "Xcode with the device connected to have the symbols generated.") - .arg(deviceSdk1.toUserOutput()))); - } + const QString osVersion = dev->osVersion(); + const QString cpuArchitecture = dev->cpuArchitecture(); + const FilePaths symbolsPathCandidates = { + FilePath::fromString(QDir::homePath() + "/Library/Developer/Xcode/iOS DeviceSupport/" + + osVersion + " " + cpuArchitecture + "/Symbols"), + FilePath::fromString(QDir::homePath() + "/Library/Developer/Xcode/iOS DeviceSupport/" + + osVersion + "/Symbols"), + IosConfigurations::developerPath().pathAppended( + "Platforms/iPhoneOS.platform/DeviceSupport/" + osVersion + "/Symbols")}; + const FilePath deviceSdk = Utils::findOrDefault(symbolsPathCandidates, &FilePath::isDir); + + if (deviceSdk.isEmpty()) { + TaskHub::addTask(DeploymentTask( + Task::Warning, + tr("Could not find device specific debug symbols at %1. " + "Debugging initialization will be slow until you open the Organizer window of " + "Xcode with the device connected to have the symbols generated.") + .arg(symbolsPathCandidates.constFirst().toUserOutput()))); } - setDeviceSymbolsRoot(deviceSdk); + setDeviceSymbolsRoot(deviceSdk.toString()); } else { setStartMode(AttachExternal); setIosPlatform("ios-simulator"); |