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
This commit is contained in:
con
2010-11-25 17:47:56 +01:00
parent 61ebb308e6
commit 3565245018
4 changed files with 63 additions and 31 deletions

View File

@@ -244,7 +244,7 @@ void TcfTrkGdbAdapter::handleTcfTrkRunControlModuleLoadContextSuspendedEvent(con
const QByteArray symbolFile = m_symbolFile.toLocal8Bit(); const QByteArray symbolFile = m_symbolFile.toLocal8Bit();
if (symbolFile.isEmpty()) { if (symbolFile.isEmpty()) {
logMessage(_("WARNING: No symbol file available."), LogWarning); logMessage(_("WARNING: No symbol file available."), LogError);
} else { } else {
// Does not seem to be necessary anymore. // Does not seem to be necessary anymore.
// FIXME: Startup sequence can be streamlined now as we do not // FIXME: Startup sequence can be streamlined now as we do not

View File

@@ -1651,7 +1651,7 @@ void TrkGdbAdapter::handleCreateProcess(const TrkResult &result)
const QByteArray symbolFile = m_symbolFile.toLocal8Bit(); const QByteArray symbolFile = m_symbolFile.toLocal8Bit();
if (symbolFile.isEmpty()) { if (symbolFile.isEmpty()) {
logMessage(_("WARNING: No symbol file available."), LogWarning); logMessage(_("WARNING: No symbol file available."), LogError);
} else { } else {
// Does not seem to be necessary anymore. // Does not seem to be necessary anymore.
// FIXME: Startup sequence can be streamlined now as we do not // FIXME: Startup sequence can be streamlined now as we do not

View File

@@ -275,21 +275,21 @@ QString S60DeviceRunConfiguration::symbianTarget() const
return isDebug() ? QLatin1String("udeb") : QLatin1String("urel"); return isDebug() ? QLatin1String("udeb") : QLatin1String("urel");
} }
QString S60DeviceRunConfiguration::symbianPlatform() const static inline QString symbianPlatformForToolChain(ProjectExplorer::ToolChainType t)
{ {
const Qt4BuildConfiguration *qt4bc = qt4Target()->activeBuildConfiguration(); switch (t) {
switch (qt4bc->toolChainType()) {
case ProjectExplorer::ToolChain_GCCE: case ProjectExplorer::ToolChain_GCCE:
case ProjectExplorer::ToolChain_GCCE_GNUPOC: case ProjectExplorer::ToolChain_GCCE_GNUPOC:
return QLatin1String("gcce"); return QLatin1String("gcce");
case ProjectExplorer::ToolChain_RVCT_ARMV5: case ProjectExplorer::ToolChain_RVCT_ARMV5:
return QLatin1String("armv5"); return QLatin1String("armv5");
default: // including ProjectExplorer::RVCT_ARMV6_GNUPOC: default: // including ProjectExplorer::RVCT_ARMV6_GNUPOC:
return QLatin1String("armv6"); break;
} }
return QLatin1String("armv6");
} }
/* Grep a package file for the '.exe' file. Curently for use on Linux only /* Grep a package file for the '.exe' file. Currently for use on Linux only
* as the '.pkg'-files on Windows do not contain drive letters, which is not * as the '.pkg'-files on Windows do not contain drive letters, which is not
* handled here. \code * handled here. \code
; Executable and default resource files ; Executable and default resource files
@@ -317,29 +317,51 @@ static inline QString executableFromPackageUnix(const QString &packageFileName)
return QString(); return QString();
} }
// ABLD/Raptor: Return executable from device/EPOC
static inline QString localExecutableFromDevice(const QtVersion *qtv,
const QString &symbianTarget, /* udeb/urel */
const QString &targetName,
ProjectExplorer::ToolChainType t)
{
QTC_ASSERT(qtv, return QString(); )
const S60Devices::Device device = S60Manager::instance()->deviceForQtVersion(qtv);
QString localExecutable;
QTextStream(&localExecutable) << device.epocRoot << "/epoc32/release/"
<< symbianPlatformForToolChain(t)
<< '/' << symbianTarget << '/' << targetName
<< ".exe";
return localExecutable;
}
QString S60DeviceRunConfiguration::localExecutableFileName() const QString S60DeviceRunConfiguration::localExecutableFileName() const
{ {
QString localExecutable; const ProjectExplorer::ToolChainType toolChain = toolChainType();
switch (toolChainType()) { switch (toolChain) {
case ProjectExplorer::ToolChain_GCCE_GNUPOC: case ProjectExplorer::ToolChain_GCCE_GNUPOC:
case ProjectExplorer::ToolChain_RVCT_ARMV5_GNUPOC: { case ProjectExplorer::ToolChain_RVCT_ARMV5_GNUPOC: {
TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()->targetInformation(projectFilePath()); TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()->targetInformation(projectFilePath());
if (!ti.valid) if (!ti.valid)
return QString(); return QString();
localExecutable = executableFromPackageUnix(ti.buildDir + QLatin1Char('/') + ti.target + QLatin1String("_template.pkg")); return executableFromPackageUnix(ti.buildDir + QLatin1Char('/') + ti.target + QLatin1String("_template.pkg"));
} }
case ProjectExplorer::ToolChain_RVCT_ARMV5:
case ProjectExplorer::ToolChain_RVCT_ARMV6:
return localExecutableFromDevice(qtVersion(), symbianTarget(), targetName(), toolChain);
break; break;
default: { case ProjectExplorer::ToolChain_GCCE: {
// As of 4.7.1, qmake-gcce-Raptor builds were changed to put all executables into 'armv5'
const QtVersion *qtv = qtVersion(); const QtVersion *qtv = qtVersion();
QTC_ASSERT(qtv, return QString()); QTC_ASSERT(qtv, return QString(); )
const S60Devices::Device device = S60Manager::instance()->deviceForQtVersion(qtv); return qtv->isBuildWithSymbianSbsV2() ?
QTextStream(&localExecutable) << device.epocRoot << "/epoc32/release/" localExecutableFromDevice(qtv, symbianTarget(), targetName(), ProjectExplorer::ToolChain_RVCT_ARMV5) :
<< symbianPlatform() << '/' << symbianTarget() << '/' << targetName() localExecutableFromDevice(qtv, symbianTarget(), targetName(), toolChain);
<< ".exe";
} }
break; break;
default:
break;
} }
return QDir::toNativeSeparators(localExecutable); return QString();
} }
quint32 S60DeviceRunConfiguration::executableUid() const quint32 S60DeviceRunConfiguration::executableUid() const
@@ -728,6 +750,25 @@ static inline QString localExecutable(const S60DeviceRunConfiguration *rc)
return QString(); 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 // Create start parameters from run configuration
Debugger::DebuggerStartParameters S60DeviceDebugRunControl::s60DebuggerStartParams(const S60DeviceRunConfiguration *rc) Debugger::DebuggerStartParameters S60DeviceDebugRunControl::s60DebuggerStartParams(const S60DeviceRunConfiguration *rc)
{ {
@@ -749,15 +790,8 @@ Debugger::DebuggerStartParameters S60DeviceDebugRunControl::s60DebuggerStartPara
QTC_ASSERT(sp.executableUid, return sp); QTC_ASSERT(sp.executableUid, return sp);
// Prefer the '*.sym' file over the '.exe', which should exist at the same // Prefer the '*.sym' file over the '.exe', which should exist at the same
// location in debug builds // location in debug builds. This can be 'foo.exe' (ABLD) or 'foo.exe.sym' (Raptor)
const QString localExecutableFileName = localExecutable(rc); sp.symbolFileName = symbolFileFromExecutable(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;
}
return sp; return sp;
} }

View File

@@ -90,11 +90,9 @@ public:
bool isDebug() const; bool isDebug() const;
QString symbianTarget() const; QString symbianTarget() const;
QString symbianPlatform() const;
QVariantMap toMap() const; QVariantMap toMap() const;
signals: signals:
void targetInformationChanged(); void targetInformationChanged();