From 958a53dd313f57a00e676d8a226d7712d0d6f7f3 Mon Sep 17 00:00:00 2001
From: Kai Koehne <kai.koehne@nokia.com>
Date: Wed, 1 Jun 2011 16:16:28 +0200
Subject: [PATCH] Debugger: Add project directory / file information also for
 S60/Maemo

The project directory / list of files are used to map remote to local files
for QML debugging.

Change-Id: I5aa1c4ea495d457e7af05bafcfead9c434231758
Reviewed-on: http://codereview.qt.nokia.com/311
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: hjk <qthjk@ovi.com>
---
 .../qt-s60/s60devicerunconfiguration.cpp                  | 8 ++++++++
 src/plugins/remotelinux/maemodebugsupport.cpp             | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
index 6617fc7fb85..d40689d9ea3 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
@@ -475,6 +475,14 @@ static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceR
                 Debugger::DebuggerStartParameters::SymbianDebugClientTrk:
                 Debugger::DebuggerStartParameters::SymbianDebugClientCoda;
 
+    if (const ProjectExplorer::Project *project = rc->target()->project()) {
+        sp.projectSourceDirectory = project->projectDirectory();
+        if (const ProjectExplorer::BuildConfiguration *buildConfig = rc->target()->activeBuildConfiguration()) {
+            sp.projectBuildDirectory = buildConfig->buildDirectory();
+        }
+        sp.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
+    }
+
     QTC_ASSERT(sp.executableUid, return sp);
 
     // Prefer the '*.sym' file over the '.exe', which should exist at the same
diff --git a/src/plugins/remotelinux/maemodebugsupport.cpp b/src/plugins/remotelinux/maemodebugsupport.cpp
index 1341a5b1626..addf73e62f1 100644
--- a/src/plugins/remotelinux/maemodebugsupport.cpp
+++ b/src/plugins/remotelinux/maemodebugsupport.cpp
@@ -106,6 +106,14 @@ RunControl *MaemoDebugSupport::createDebugRunControl(RemoteLinuxRunConfiguration
     }
     params.displayName = runConfig->displayName();
 
+    if (const ProjectExplorer::Project *project = runConfig->target()->project()) {
+        params.projectSourceDirectory = project->projectDirectory();
+        if (const ProjectExplorer::BuildConfiguration *buildConfig = runConfig->target()->activeBuildConfiguration()) {
+            params.projectBuildDirectory = buildConfig->buildDirectory();
+        }
+        params.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
+    }
+
     DebuggerRunControl * const runControl =
         DebuggerPlugin::createDebugger(params, runConfig);
     bool useGdb = params.startMode == StartRemoteGdb
-- 
GitLab