aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@digia.com>2013-12-10 12:53:20 +0100
committerFawzi Mohamed <fawzi.mohamed@digia.com>2014-01-08 13:42:43 +0100
commit323a0c6291df7f7ff57ec5b8b32ea1e0eedd8af4 (patch)
treee1405db0f68841c736aa37bc54a182b1a0ff3f6e /src
parent55ec629e4d3f9e42878f76a5a216d29394d1ccf8 (diff)
ios: speed up device debugging
Correctly use the device specific cached symbols to avoid downloading them from the device (big slowdown). Task-number: QTCREATORBUG-10884 Change-Id: Ic82482e4b1dadf55f695a67fd420ac1b095a3ca1 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/debugger/debuggerstartparameters.h1
-rw-r--r--src/plugins/debugger/lldb/lldbengine.cpp2
-rw-r--r--src/plugins/ios/iosdebugsupport.cpp31
-rw-r--r--src/plugins/ios/iosdevice.cpp15
-rw-r--r--src/plugins/ios/iosdevice.h4
-rw-r--r--src/tools/iostool/iosdevicemanager.cpp27
6 files changed, 63 insertions, 17 deletions
diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h
index b66500a841..935fe9153f 100644
--- a/src/plugins/debugger/debuggerstartparameters.h
+++ b/src/plugins/debugger/debuggerstartparameters.h
@@ -86,6 +86,7 @@ public:
DebuggerEngineType secondSlaveEngineType;
DebuggerEngineType cppEngineType;
QString sysRoot;
+ QString deviceSymbolsRoot;
QString debuggerCommand;
ProjectExplorer::Abi toolChainAbi;
ProjectExplorer::IDevice::ConstPtr device;
diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp
index e1cf884176..e640c87257 100644
--- a/src/plugins/debugger/lldb/lldbengine.cpp
+++ b/src/plugins/debugger/lldb/lldbengine.cpp
@@ -203,7 +203,7 @@ void LldbEngine::setupInferior()
QTC_CHECK(sp.attachPID <= 0 || (sp.startMode == AttachCrashedExternal
|| sp.startMode == AttachExternal));
cmd.arg("attachPid", sp.attachPID);
- cmd.arg("sysRoot", sp.sysRoot);
+ cmd.arg("sysRoot", sp.deviceSymbolsRoot.isEmpty() ? sp.sysRoot : sp.deviceSymbolsRoot);
cmd.arg("remoteChannel", ((sp.startMode == AttachToRemoteProcess
|| sp.startMode == AttachToRemoteServer)
? sp.remoteChannel : QString()));
diff --git a/src/plugins/ios/iosdebugsupport.cpp b/src/plugins/ios/iosdebugsupport.cpp
index 4b82e207e5..174ea9bd9c 100644
--- a/src/plugins/ios/iosdebugsupport.cpp
+++ b/src/plugins/ios/iosdebugsupport.cpp
@@ -31,6 +31,7 @@
#include "iosrunner.h"
#include "iosmanager.h"
+#include "iosdevice.h"
#include <debugger/debuggerengine.h>
#include <debugger/debuggerplugin.h>
@@ -40,10 +41,12 @@
#include <debugger/debuggerrunconfigurationaspect.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/target.h>
+#include <projectexplorer/taskhub.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qtsupport/qtkitinformation.h>
+#include <utils/fileutils.h>
#include <QDir>
#include <QTcpServer>
@@ -73,11 +76,38 @@ RunControl *IosDebugSupport::createDebugRunControl(IosRunConfiguration *runConfi
if (device.isNull())
return 0;
QmakeProject *project = static_cast<QmakeProject *>(target->project());
+ Kit *kit = target->kit();
DebuggerStartParameters params;
if (device->type() == Core::Id(Ios::Constants::IOS_DEVICE_TYPE)) {
params.startMode = AttachToRemoteProcess;
params.platform = QLatin1String("remote-ios");
+ IosDevice::ConstPtr iosDevice = device.dynamicCast<const IosDevice>();
+ if (iosDevice.isNull())
+ return 0;
+ QString osVersion = iosDevice->osVersion();
+ Utils::FileName deviceSdk1 = Utils::FileName::fromString(QDir::homePath()
+ + QLatin1String("/Library/Developer/Xcode/iOS DeviceSupport/")
+ + osVersion + QLatin1String("/Symbols"));
+ QString deviceSdk;
+ if (deviceSdk1.toFileInfo().isDir()) {
+ deviceSdk = deviceSdk1.toString();
+ } else {
+ Utils::FileName deviceSdk2 = IosConfigurations::developerPath()
+ .appendPath(QLatin1String("Platforms/iPhoneOS.platform/DeviceSupport/"))
+ .appendPath(osVersion).appendPath(QLatin1String("Symbols"));
+ if (deviceSdk2.toFileInfo().isDir()) {
+ deviceSdk = deviceSdk2.toString();
+ } else {
+ TaskHub::addTask(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()),
+ ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
+ }
+ }
+ params.deviceSymbolsRoot = deviceSdk;
} else {
params.startMode = AttachExternal;
params.platform = QLatin1String("ios-simulator");
@@ -91,7 +121,6 @@ RunControl *IosDebugSupport::createDebugRunControl(IosRunConfiguration *runConfi
= runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
if (aspect->useCppDebugger()) {
params.languages |= CppLanguage;
- Kit *kit = target->kit();
params.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
params.debuggerCommand = DebuggerKitInformation::debuggerCommand(kit).toString();
if (ToolChain *tc = ToolChainKitInformation::toolChain(kit))
diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp
index a9753cadb1..ba4631be82 100644
--- a/src/plugins/ios/iosdevice.cpp
+++ b/src/plugins/ios/iosdevice.cpp
@@ -190,21 +190,11 @@ QString IosDevice::name()
return QCoreApplication::translate("Ios::Internal::IosDevice", "iOS Device");
}
-/*
-// add back?
-
-QString IosDevice::cpuArchitecure() const
+QString IosDevice::osVersion() const
{
- return m_extraInfo.value(QLatin1String("deviceInfo")).toMap()
- .value(QLatin1String("CPUArchitecture")).toString();
+ return m_extraInfo.value(QLatin1String("osVersion"));
}
-QString IosDevice::productType() const
-{
- return m_extraInfo.value(QLatin1String("deviceInfo")).toMap()
- .value(QLatin1String("ProductType")).toString();
-}*/
-
// IosDeviceManager
@@ -222,6 +212,7 @@ IosDeviceManager::TranslationMap IosDeviceManager::translationMap()
tMap[QLatin1String("NO")] = tr("no");
tMap[QLatin1String("YES")] = tr("yes");
tMap[QLatin1String("*unknown*")] = tr("unknown");
+ tMap[QLatin1String("osVersion")] = tr("OS version");
translationMap = &tMap;
return tMap;
}
diff --git a/src/plugins/ios/iosdevice.h b/src/plugins/ios/iosdevice.h
index f480f3a62f..a0f9456ec7 100644
--- a/src/plugins/ios/iosdevice.h
+++ b/src/plugins/ios/iosdevice.h
@@ -65,9 +65,7 @@ public:
QVariantMap toMap() const;
QString uniqueDeviceID() const;
IosDevice(const QString &uid);
- // add back? currently unused...
- //QString cpuArchitecure() const;
- //QString productType() const;
+ QString osVersion() const;
static QString name();
diff --git a/src/tools/iostool/iosdevicemanager.cpp b/src/tools/iostool/iosdevicemanager.cpp
index 3bc83bb027..ce61347c61 100644
--- a/src/tools/iostool/iosdevicemanager.cpp
+++ b/src/tools/iostool/iosdevicemanager.cpp
@@ -1227,6 +1227,7 @@ void DevInfoSession::deviceCallbackReturned()
QString deviceNameKey = QLatin1String("deviceName");
QString developerStatusKey = QLatin1String("developerStatus");
QString deviceConnectedKey = QLatin1String("deviceConnected");
+ QString osVersionKey = QLatin1String("osVersion");
bool failure = !device;
if (!failure) {
failure = !connectDevice();
@@ -1256,6 +1257,32 @@ void DevInfoSession::deviceCallbackReturned()
if (!res.contains(developerStatusKey))
res[developerStatusKey] = QLatin1String("*off*");
}
+ if (!failure) {
+ CFPropertyListRef cfProductVersion = lib()->deviceCopyValue(device,
+ 0,
+ CFSTR("ProductVersion"));
+ //CFShow(cfProductVersion);
+ CFPropertyListRef cfBuildVersion = lib()->deviceCopyValue(device,
+ 0,
+ CFSTR("BuildVersion"));
+ //CFShow(cfBuildVersion);
+ QString versionString;
+ if (cfProductVersion) {
+ if (CFGetTypeID(cfProductVersion) == CFStringGetTypeID())
+ versionString = CFStringRef2QString(reinterpret_cast<CFStringRef>(cfProductVersion));
+ CFRelease(cfProductVersion);
+ }
+ if (cfBuildVersion) {
+ if (!versionString.isEmpty() && CFGetTypeID(cfBuildVersion) == CFStringGetTypeID())
+ versionString += QString::fromLatin1(" (%1)").arg(
+ CFStringRef2QString(reinterpret_cast<CFStringRef>(cfBuildVersion)));
+ CFRelease(cfBuildVersion);
+ }
+ if (!versionString.isEmpty())
+ res[osVersionKey] = versionString;
+ else
+ res[osVersionKey] = QLatin1String("*unknown*");
+ }
disconnectDevice();
}
if (!res.contains(deviceConnectedKey))