Debugger: Consolidate extraction of project related data for run

Setting projectSourceFiles etc once is sufficient.

Change-Id: I340406e2f7de82bd9919aa9ec0ff1982b2118e59
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2016-04-13 10:04:49 +02:00
parent 075a8dc831
commit 2e9b52d084

View File

@@ -329,13 +329,6 @@ static DebuggerRunControl *doCreate(DebuggerRunParameters rp, RunConfiguration *
{
QTC_ASSERT(kit, return 0);
Target *target = 0;
Project *project = 0;
// Find a Kit and Target. Either could be missing.
if (runConfig)
target = runConfig->target();
// Extract as much as possible from available RunConfiguration.
if (runConfig && runConfig->runnable().is<StandardRunnable>()) {
rp.inferior = runConfig->runnable().as<StandardRunnable>();
@@ -359,24 +352,16 @@ static DebuggerRunControl *doCreate(DebuggerRunParameters rp, RunConfiguration *
rp.stubEnvironment = rp.inferior.environment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX
rp.debuggerEnvironment = rp.inferior.environment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX
}
if (Project *project = runConfig->target()->project()) {
rp.projectSourceDirectory = project->projectDirectory().toString();
rp.projectSourceFiles = project->files(Project::SourceFiles);
}
}
if (ToolChain *tc = ToolChainKitInformation::toolChain(kit))
rp.toolChainAbi = tc->targetAbi();
if (target)
project = target->project();
if (project && rp.projectSourceDirectory.isEmpty())
rp.projectSourceDirectory = project->projectDirectory().toString();
if (project && rp.projectSourceFiles.isEmpty())
rp.projectSourceFiles = project->files(Project::SourceFiles);
if (project && rp.projectSourceFiles.isEmpty())
rp.projectSourceFiles = project->files(Project::SourceFiles);
if (false && project) {
if (false) {
const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
rp.nativeMixedEnabled = version && version->qtVersion() >= QtSupport::QtVersionNumber(5, 7, 0);
}
@@ -391,11 +376,6 @@ static DebuggerRunControl *doCreate(DebuggerRunParameters rp, RunConfiguration *
rp.debuggerCommand = DebuggerKitInformation::debuggerCommand(kit).toString();
rp.device = DeviceKitInformation::device(kit);
if (project) {
rp.projectSourceDirectory = project->projectDirectory().toString();
rp.projectSourceFiles = project->files(Project::SourceFiles);
}
if (rp.displayName.isEmpty() && runConfig)
rp.displayName = runConfig->displayName();