diff options
author | con <qtc-committer@nokia.com> | 2010-11-25 15:54:21 +0100 |
---|---|---|
committer | con <qtc-committer@nokia.com> | 2010-11-25 15:54:21 +0100 |
commit | fb3524af9056632595e00504a52d03327a41a6b1 (patch) | |
tree | 0404a29a6e103310ca1e58d02cea5d88c9d452eb /src/plugins | |
parent | bd8b23d4bad4191367e7c5eb3297769a2477afec (diff) | |
download | qt-creator-fb3524af9056632595e00504a52d03327a41a6b1.tar.gz |
Fix debugging Symbian gcce raptor built apps.
Local executable is put into a different folder
(always 'armv5' despite it being a 'gcce' build, changed in qmake),
and the symbol file is named 'foo.exe.sym' instead of 'foo.sym'.
Done-by: Friedemann Kleint
Reviewed-by: Pawel Polanski
Diffstat (limited to 'src/plugins')
4 files changed, 67 insertions, 33 deletions
diff --git a/src/plugins/debugger/gdb/tcftrkgdbadapter.cpp b/src/plugins/debugger/gdb/tcftrkgdbadapter.cpp index 1169da30f0..e75d75b688 100644 --- a/src/plugins/debugger/gdb/tcftrkgdbadapter.cpp +++ b/src/plugins/debugger/gdb/tcftrkgdbadapter.cpp @@ -242,7 +242,7 @@ void TcfTrkGdbAdapter::handleTcfTrkRunControlModuleLoadContextSuspendedEvent(con const QByteArray symbolFile = m_symbolFile.toLocal8Bit(); if (symbolFile.isEmpty()) { - logMessage(_("WARNING: No symbol file available."), LogWarning); + logMessage(_("WARNING: No symbol file available."), LogError); } else { // Does not seem to be necessary anymore. // FIXME: Startup sequence can be streamlined now as we do not diff --git a/src/plugins/debugger/gdb/trkgdbadapter.cpp b/src/plugins/debugger/gdb/trkgdbadapter.cpp index 05d1ba6bc4..102f5925a8 100644 --- a/src/plugins/debugger/gdb/trkgdbadapter.cpp +++ b/src/plugins/debugger/gdb/trkgdbadapter.cpp @@ -1640,7 +1640,7 @@ void TrkGdbAdapter::handleCreateProcess(const TrkResult &result) const QByteArray symbolFile = m_symbolFile.toLocal8Bit(); if (symbolFile.isEmpty()) { - logMessage(_("WARNING: No symbol file available."), LogWarning); + logMessage(_("WARNING: No symbol file available."), LogError); } else { // Does not seem to be necessary anymore. // FIXME: Startup sequence can be streamlined now as we do not diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp index 4c4b7ba9b3..ff1531a9c9 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp @@ -251,18 +251,18 @@ QString S60DeviceRunConfiguration::symbianTarget() const return isDebug() ? QLatin1String("udeb") : QLatin1String("urel"); } -QString S60DeviceRunConfiguration::symbianPlatform() const +static inline QString symbianPlatformForToolChain(ProjectExplorer::ToolChain::ToolChainType t) { - const Qt4BuildConfiguration *qt4bc = qt4Target()->activeBuildConfiguration(); - switch (qt4bc->toolChainType()) { - case ToolChain::GCCE: - case ToolChain::GCCE_GNUPOC: + switch (t) { + case ProjectExplorer::ToolChain::GCCE: + case ProjectExplorer::ToolChain::GCCE_GNUPOC: return QLatin1String("gcce"); - case ToolChain::RVCT_ARMV5: + case ProjectExplorer::ToolChain::RVCT_ARMV5: return QLatin1String("armv5"); - default: // including ToolChain::RVCT_ARMV6_GNUPOC: - return QLatin1String("armv6"); + default: // including ProjectExplorer::RVCT_ARMV6_GNUPOC: + break; } + return QLatin1String("armv6"); } /* Grep a package file for the '.exe' file. Curently for use on Linux only @@ -293,29 +293,52 @@ static inline QString executableFromPackageUnix(const QString &packageFileName) return QString(); } -QString S60DeviceRunConfiguration::localExecutableFileName() const +// ABLD/Raptor: Return executable from device/EPOC +static inline QString localExecutableFromDevice(const QtVersion *qtv, + const QString &symbianTarget, /* udeb/urel */ + const QString &targetName, + ProjectExplorer::ToolChain::ToolChainType t) { + QTC_ASSERT(qtv, return QString(); ) + + const S60Devices::Device device = S60Manager::instance()->deviceForQtVersion(qtv); QString localExecutable; - switch (toolChainType()) { + QTextStream(&localExecutable) << device.epocRoot << "/epoc32/release/" + << symbianPlatformForToolChain(t) + << '/' << symbianTarget << '/' << targetName + << ".exe"; + return localExecutable; +} + +QString S60DeviceRunConfiguration::localExecutableFileName() const +{ + const ProjectExplorer::ToolChain::ToolChainType toolChain = toolChainType(); + switch (toolChain) { case ToolChain::GCCE_GNUPOC: case ToolChain::RVCT_ARMV5_GNUPOC: { TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()->targetInformation(projectFilePath()); if (!ti.valid) return QString(); - localExecutable = executableFromPackageUnix(ti.buildDir + QLatin1Char('/') + ti.target + QLatin1String("_template.pkg")); - } + return executableFromPackageUnix(ti.buildDir + QLatin1Char('/') + ti.target + QLatin1String("_template.pkg")); + } break; - default: { - const QtVersion *qtv = qtVersion(); - QTC_ASSERT(qtv, return QString()); - const S60Devices::Device device = S60Manager::instance()->deviceForQtVersion(qtv); - QTextStream(&localExecutable) << device.epocRoot << "/epoc32/release/" - << symbianPlatform() << '/' << symbianTarget() << '/' << targetName() - << ".exe"; - } + case ProjectExplorer::ToolChain::RVCT_ARMV5: + case ProjectExplorer::ToolChain::RVCT_ARMV6: + return localExecutableFromDevice(qtVersion(), symbianTarget(), targetName(), toolChain); + break; + case ProjectExplorer::ToolChain::GCCE: { + // As of 4.7.0, qmake-gcce-Raptor builds were changed to put all executables into 'armv5' + const QtVersion *qtv = qtVersion(); + QTC_ASSERT(qtv, return QString(); ) + return qtv->isBuildWithSymbianSbsV2() ? + localExecutableFromDevice(qtv, symbianTarget(), targetName(), ProjectExplorer::ToolChain::RVCT_ARMV5) : + localExecutableFromDevice(qtv, symbianTarget(), targetName(), toolChain); + } + break; + default: break; } - return QDir::toNativeSeparators(localExecutable); + return QString(); } quint32 S60DeviceRunConfiguration::executableUid() const @@ -703,6 +726,25 @@ static inline QString localExecutable(const S60DeviceRunConfiguration *rc) return QString(); } +// Return symbol file which should co-exist with the executable. +// location in debug builds. This can be 'foo.sym' (ABLD) or 'foo.exe.sym' (Raptor) +static inline QString symbolFileFromExecutable(const QString &executable) +{ + // 'foo.exe.sym' (Raptor) + const QFileInfo raptorSymFi(executable + QLatin1String(".sym")); + if (raptorSymFi.isFile()) + return raptorSymFi.absoluteFilePath(); + // 'foo.sym' (ABLD) + const int lastDotPos = executable.lastIndexOf(QLatin1Char('.')); + if (lastDotPos != -1) { + const QString symbolFileName = executable.mid(0, lastDotPos) + QLatin1String(".sym"); + const QFileInfo symbolFileNameFi(symbolFileName); + if (symbolFileNameFi.isFile()) + return symbolFileNameFi.absoluteFilePath(); + } + return QString(); +} + // Create start parameters from run configuration Debugger::DebuggerStartParameters S60DeviceDebugRunControl::s60DebuggerStartParams(const S60DeviceRunConfiguration *rc) { @@ -724,15 +766,8 @@ Debugger::DebuggerStartParameters S60DeviceDebugRunControl::s60DebuggerStartPara QTC_ASSERT(sp.executableUid, return sp); // Prefer the '*.sym' file over the '.exe', which should exist at the same - // location in debug builds - const QString localExecutableFileName = localExecutable(rc); - const int lastDotPos = localExecutableFileName.lastIndexOf(QLatin1Char('.')); - if (lastDotPos != -1) { - const QString symbolFileName = localExecutableFileName.mid(0, lastDotPos) + QLatin1String(".sym"); - if (QFileInfo(symbolFileName).isFile()) - sp.symbolFileName = symbolFileName; - } - + // location in debug builds. This can be 'foo.exe' (ABLD) or 'foo.exe.sym' (Raptor) + sp.symbolFileName = symbolFileFromExecutable(localExecutable(rc)); return sp; } diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h index 8ed9ed543c..f0f0e2e5d1 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h @@ -93,7 +93,6 @@ public: bool isDebug() const; QString symbianTarget() const; - QString symbianPlatform() const; QVariantMap toMap() const; |