Debugger: Continue DebuggerStartParameter cleanup

- Move sysRoot, debuggerCommand, targetAbi to DebuggerRunParameters,
  they are always the one coming from the kit.
- Move projectSource{Directory,Files} to DebuggerRunParameters,
  they are alway coming from the runConfiguration's project
- Pass RunConfiguration always as separate parameter, that's
  what related code does.

Change-Id: I9965a052237af53fa2d170701bc88b552cab12ed
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
hjk
2015-06-26 13:06:08 +02:00
parent f84169b51e
commit 1538dca81a
16 changed files with 90 additions and 225 deletions

View File

@@ -89,17 +89,10 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
params.startMode = AttachToRemoteServer;
params.displayName = AndroidManager::packageName(target);
params.remoteSetupNeeded = true;
params.runConfiguration = runConfig;
DebuggerRunConfigurationAspect *aspect
= runConfig->extraAspect<DebuggerRunConfigurationAspect>();
auto aspect = runConfig->extraAspect<DebuggerRunConfigurationAspect>();
if (aspect->useCppDebugger()) {
params.languages |= CppLanguage;
Kit *kit = target->kit();
params.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
params.debuggerCommand = DebuggerKitInformation::debuggerCommand(kit).toString();
if (ToolChain *tc = ToolChainKitInformation::toolChain(kit))
params.toolChainAbi = tc->targetAbi();
params.executable = target->activeBuildConfiguration()->buildDirectory().toString() + QLatin1String("/app_process");
params.skipExecutableValidation = true;
params.remoteChannel = runConfig->remoteChannel();
@@ -108,25 +101,20 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
params.solibSearchPath.append(qtSoPaths(version));
}
if (aspect->useQmlDebugger()) {
params.languages |= QmlLanguage;
QTcpServer server;
QTC_ASSERT(server.listen(QHostAddress::LocalHost)
|| server.listen(QHostAddress::LocalHostIPv6), return 0);
params.qmlServerAddress = server.serverAddress().toString();
params.remoteSetupNeeded = true;
//TODO: Not sure if these are the right paths.
params.projectSourceDirectory = target->project()->projectDirectory().toString();
Kit *kit = target->kit();
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
if (version) {
const QString qmlQtDir = version->versionInfo().value(QLatin1String("QT_INSTALL_QML"));
params.additionalSearchDirectories = QStringList(qmlQtDir);
}
params.projectSourceFiles = target->project()->files(Project::ExcludeGeneratedFiles);
params.projectBuildDirectory = target->activeBuildConfiguration()->buildDirectory().toString();
}
DebuggerRunControl * const debuggerRunControl = createDebuggerRunControl(params, errorMessage);
DebuggerRunControl * const debuggerRunControl = createDebuggerRunControl(params, runConfig, errorMessage);
new AndroidDebugSupport(runConfig, debuggerRunControl);
return debuggerRunControl;
}