From 2e9b52d08404fc46582c6ecca4584235fb7a73ec Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 13 Apr 2016 10:04:49 +0200 Subject: [PATCH] Debugger: Consolidate extraction of project related data for run Setting projectSourceFiles etc once is sufficient. Change-Id: I340406e2f7de82bd9919aa9ec0ff1982b2118e59 Reviewed-by: Christian Stenger --- src/plugins/debugger/debuggerruncontrol.cpp | 30 ++++----------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index b8bb1c8d4c5..122550be5ab 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -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()) { rp.inferior = runConfig->runnable().as(); @@ -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();