forked from qt-creator/qt-creator
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 <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user