diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index e620fae251ef4a2510af2cb161e3025098b98097..fa3d7ffa2a7871cdaaa8e28eaa433f28c52de593 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -84,6 +84,8 @@ public: QString sysRoot; QByteArray remoteDumperLib; QByteArray remoteSourcesDir; + QString remoteMountPoint; + QString localMountDir; Core::SshConnectionParameters connParams; QString debuggerCommand; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 0f08f312ccf549033500848024b1e2a5b8c104c7..a5b9da7f82e2b6f4912ea6fc5b69457cb8b4d605 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1587,18 +1587,23 @@ QString GdbEngine::fullName(const QString &fileName) return m_shortToFullName.value(fileName, QString()); } -#ifdef Q_OS_WIN QString GdbEngine::cleanupFullName(const QString &fileName) { + QString cleanFilePath = fileName; +#ifdef Q_OS_WIN QTC_ASSERT(!fileName.isEmpty(), return QString()) // Gdb on windows often delivers "fullnames" which // a) have no drive letter and b) are not normalized. QFileInfo fi(fileName); - if (!fi.isReadable()) - return QString(); - return QDir::cleanPath(fi.absoluteFilePath()); -} + if (fi.isReadable()) + cleanFilePath = QDir::cleanPath(fi.absoluteFilePath()); #endif + if (startMode() == StartRemoteGdb) { + cleanFilePath.replace(0, startParameters().remoteMountPoint.length(), + startParameters().localMountDir); + } + return cleanFilePath; +} void GdbEngine::shutdownInferior() { diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index f75ccf3a10b123831051afc9c3fd09afd5bb38c2..3cf89306b2c830f6bcacb330771f1f1c845065ab 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -411,11 +411,7 @@ private: ////////// View & Data Stuff ////////// void handleQuerySources(const GdbResponse &response); QString fullName(const QString &fileName); -#ifdef Q_OS_WIN QString cleanupFullName(const QString &fileName); -#else - QString cleanupFullName(const QString &fileName) { return fileName; } -#endif // awful hack to keep track of used files QMap<QString, QString> m_shortToFullName; diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp index 4a759e4d5443546048a1e2b1137d2f5578c4a763..4420bb635c1fb5d56941a4716b16a5f928cb8f89 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp @@ -70,13 +70,14 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC = MaemoGlobal::remoteCommandPrefix(runConfig->remoteExecutableFilePath()) + QLatin1String(" /usr/bin/gdb"); params.connParams = devConf.server; + params.localMountDir = runConfig->localDirToMountForRemoteGdb(); + params.remoteMountPoint = MaemoGlobal::remoteProjectSourcesMountPoint(); const QString execDirAbs = QDir::fromNativeSeparators(QFileInfo(runConfig->localExecutableFilePath()).path()); const QString execDirRel - = QDir(runConfig->localDirToMountForRemoteGdb()).relativeFilePath(execDirAbs); - params.remoteSourcesDir - = QString(MaemoGlobal::remoteProjectSourcesMountPoint() - + QLatin1Char('/') + execDirRel).toUtf8(); + = QDir(params.localMountDir).relativeFilePath(execDirAbs); + params.remoteSourcesDir = QString(params.remoteMountPoint + + QLatin1Char('/') + execDirRel).toUtf8(); } else { params.startMode = AttachToRemote; params.executable = runConfig->localExecutableFilePath();