diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 1ca6e3171566c7c3c33fe00407ccb12decda0a3b..1349f6f6b1ad8e981f25d3c45e0e5367aa383e07 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1803,7 +1803,10 @@ void DebuggerPluginPrivate::attachToQmlPort()
     foreach (Project *project, projects)
         sourceFiles << project->files(Project::ExcludeGeneratedFiles);
 
+    sp.projectSourceDirectory =
+            !projects.isEmpty() ? projects.first()->projectDirectory() : QString();
     sp.projectSourceFiles = sourceFiles;
+    sp.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
     DebuggerRunControlFactory::createAndScheduleRun(sp);
 }