summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-02-10 13:21:22 +0100
committerhjk <hjk@theqtcompany.com>2015-02-10 14:27:32 +0000
commitbf6aa3cc2b078e4130c67e37ae765ea61ac6e0f5 (patch)
tree7662352022a32231614b10f9dd0f37248eb155aa /src
parent807c3a5ad2c79a3da28c6740b36401a3960e9226 (diff)
downloadqt-creator-bf6aa3cc2b078e4130c67e37ae765ea61ac6e0f5.tar.gz
Debugger: Pass RunControl in DebuggerStartParameters
.. to simplify DebuggerRunControlFactory::doCreate() call. Change-Id: I4dd0c224968bb8a388ea7f095b940b66ee606ab1 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/android/androiddebugsupport.cpp3
-rw-r--r--src/plugins/baremetal/baremetalruncontrolfactory.cpp4
-rw-r--r--src/plugins/debugger/debuggerruncontrol.cpp11
-rw-r--r--src/plugins/debugger/debuggerruncontrol.h3
-rw-r--r--src/plugins/debugger/debuggerstartparameters.h3
-rw-r--r--src/plugins/ios/iosdebugsupport.cpp3
-rw-r--r--src/plugins/qnx/blackberryruncontrolfactory.cpp96
-rw-r--r--src/plugins/qnx/blackberryruncontrolfactory.h2
-rw-r--r--src/plugins/qnx/qnxattachdebugsupport.cpp2
-rw-r--r--src/plugins/qnx/qnxruncontrolfactory.cpp5
-rw-r--r--src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp3
-rw-r--r--src/plugins/valgrind/memcheckengine.cpp3
-rw-r--r--src/plugins/winrt/winrtdebugsupport.cpp3
13 files changed, 74 insertions, 67 deletions
diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp
index ff5612bc3e..9a6add0ca2 100644
--- a/src/plugins/android/androiddebugsupport.cpp
+++ b/src/plugins/android/androiddebugsupport.cpp
@@ -89,6 +89,7 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
params.startMode = AttachToRemoteServer;
params.displayName = AndroidManager::packageName(target);
params.remoteSetupNeeded = true;
+ params.runConfiguration = runConfig;
DebuggerRunConfigurationAspect *aspect
= runConfig->extraAspect<DebuggerRunConfigurationAspect>();
@@ -119,7 +120,7 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
}
DebuggerRunControl * const debuggerRunControl
- = DebuggerRunControlFactory::doCreate(params, runConfig, errorMessage);
+ = DebuggerRunControlFactory::doCreate(params, errorMessage);
new AndroidDebugSupport(runConfig, debuggerRunControl);
return debuggerRunControl;
}
diff --git a/src/plugins/baremetal/baremetalruncontrolfactory.cpp b/src/plugins/baremetal/baremetalruncontrolfactory.cpp
index a6cd670e39..92aba15540 100644
--- a/src/plugins/baremetal/baremetalruncontrolfactory.cpp
+++ b/src/plugins/baremetal/baremetalruncontrolfactory.cpp
@@ -156,8 +156,8 @@ RunControl *BareMetalRunControlFactory::create(
if (p->startupMode() == GdbServerProvider::StartupOnNetwork)
sp.remoteSetupNeeded = true;
- DebuggerRunControl *runControl =
- DebuggerRunControlFactory::doCreate(sp, rc, errorMessage);
+ sp.runConfiguration = rc;
+ DebuggerRunControl *runControl = DebuggerRunControlFactory::doCreate(sp, errorMessage);
if (runControl && sp.remoteSetupNeeded) {
const auto debugSupport = new BareMetalDebugSupport(dev, runControl);
Q_UNUSED(debugSupport);
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp
index a7e667d636..d2e068ad43 100644
--- a/src/plugins/debugger/debuggerruncontrol.cpp
+++ b/src/plugins/debugger/debuggerruncontrol.cpp
@@ -378,11 +378,12 @@ RunControl *DebuggerRunControlFactory::create
if (mode == DebugRunModeWithBreakOnMain)
sp.breakOnMain = true;
- return doCreate(sp, runConfiguration, errorMessage);
+ sp.runConfiguration = runConfiguration;
+ return doCreate(sp, errorMessage);
}
DebuggerRunControl *DebuggerRunControlFactory::doCreate
- (const DebuggerStartParameters &sp0, RunConfiguration *rc, QString *errorMessage)
+ (const DebuggerStartParameters &sp0, QString *errorMessage)
{
TaskHub::clearTasks(Debugger::Constants::TASK_CATEGORY_DEBUGGER_DEBUGINFO);
TaskHub::clearTasks(Debugger::Constants::TASK_CATEGORY_DEBUGGER_RUNTIME);
@@ -406,7 +407,7 @@ DebuggerRunControl *DebuggerRunControlFactory::doCreate
if (sp.executable.endsWith(_(".py"))) {
sp.masterEngineType = PdbEngineType;
} else {
- if (rc) {
+ if (RunConfiguration *rc = sp.runConfiguration) {
DebuggerRunConfigurationAspect *aspect
= rc->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
if (const Target *target = rc->target())
@@ -438,7 +439,7 @@ DebuggerRunControl *DebuggerRunControlFactory::doCreate
*errorMessage = error;
return 0;
}
- return new DebuggerRunControl(rc, engine);
+ return new DebuggerRunControl(sp.runConfiguration, engine);
}
IRunConfigurationAspect *DebuggerRunControlFactory::createRunConfigurationAspect(RunConfiguration *rc)
@@ -449,7 +450,7 @@ IRunConfigurationAspect *DebuggerRunControlFactory::createRunConfigurationAspect
DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun(const DebuggerStartParameters &sp)
{
QString errorMessage;
- DebuggerRunControl *rc = doCreate(sp, 0, &errorMessage);
+ DebuggerRunControl *rc = doCreate(sp, &errorMessage);
if (!rc) {
ProjectExplorerPlugin::showRunErrorMessage(errorMessage);
return 0;
diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h
index 47978fd976..44959d6fbb 100644
--- a/src/plugins/debugger/debuggerruncontrol.h
+++ b/src/plugins/debugger/debuggerruncontrol.h
@@ -118,8 +118,7 @@ public:
static DebuggerRunControl *createAndScheduleRun(const DebuggerStartParameters &sp);
- static DebuggerRunControl *doCreate(const DebuggerStartParameters &sp,
- ProjectExplorer::RunConfiguration *rc, QString *errorMessage);
+ static DebuggerRunControl *doCreate(const DebuggerStartParameters &sp, QString *errorMessage);
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect(
ProjectExplorer::RunConfiguration *rc);
diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h
index 3e6d6cfd82..b07baa868d 100644
--- a/src/plugins/debugger/debuggerstartparameters.h
+++ b/src/plugins/debugger/debuggerstartparameters.h
@@ -39,6 +39,7 @@
#include <utils/environment.h>
#include <projectexplorer/abi.h>
#include <projectexplorer/kit.h>
+#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/devicesupport/idevice.h>
#include <QMetaType>
@@ -82,6 +83,7 @@ public:
firstSlaveEngineType(NoEngineType),
secondSlaveEngineType(NoEngineType),
cppEngineType(NoEngineType),
+ runConfiguration(0),
isSnapshot(false),
attachPID(-1),
useTerminal(false),
@@ -112,6 +114,7 @@ public:
QString debuggerCommand;
ProjectExplorer::Abi toolChainAbi;
ProjectExplorer::IDevice::ConstPtr device;
+ QPointer<ProjectExplorer::RunConfiguration> runConfiguration;
QString platform;
QString executable;
diff --git a/src/plugins/ios/iosdebugsupport.cpp b/src/plugins/ios/iosdebugsupport.cpp
index a74b0cb150..fd8a1df08e 100644
--- a/src/plugins/ios/iosdebugsupport.cpp
+++ b/src/plugins/ios/iosdebugsupport.cpp
@@ -118,6 +118,7 @@ RunControl *IosDebugSupport::createDebugRunControl(IosRunConfiguration *runConfi
params.remoteSetupNeeded = true;
if (!params.breakOnMain)
params.continueAfterAttach = true;
+ params.runConfiguration = runConfig;
DebuggerRunConfigurationAspect *aspect
= runConfig->extraAspect<DebuggerRunConfigurationAspect>();
@@ -170,7 +171,7 @@ RunControl *IosDebugSupport::createDebugRunControl(IosRunConfiguration *runConfi
}
DebuggerRunControl * const debuggerRunControl
- = DebuggerRunControlFactory::doCreate(params, runConfig, errorMessage);
+ = DebuggerRunControlFactory::doCreate(params, errorMessage);
if (debuggerRunControl)
new IosDebugSupport(runConfig, debuggerRunControl, cppDebug, qmlDebug);
return debuggerRunControl;
diff --git a/src/plugins/qnx/blackberryruncontrolfactory.cpp b/src/plugins/qnx/blackberryruncontrolfactory.cpp
index 7bb6f5bb04..9eb8910669 100644
--- a/src/plugins/qnx/blackberryruncontrolfactory.cpp
+++ b/src/plugins/qnx/blackberryruncontrolfactory.cpp
@@ -114,6 +114,53 @@ static void createAnalyzerStartParameters(Analyzer::AnalyzerStartParameters *pSt
pStartParameters->analyzerPort = aspect->qmlDebugServerPort();
}
+static Debugger::DebuggerStartParameters startParameters(BlackBerryRunConfiguration *runConfig)
+{
+ Debugger::DebuggerStartParameters params;
+ ProjectExplorer::Target *target = runConfig->target();
+ ProjectExplorer::Kit *k = target->kit();
+
+ params.startMode = Debugger::AttachToRemoteServer;
+ params.debuggerCommand = Debugger::DebuggerKitInformation::debuggerCommand(k).toString();
+ params.sysRoot = ProjectExplorer::SysRootKitInformation::sysRoot(k).toString();
+ params.useCtrlCStub = true;
+ params.runConfiguration = runConfig;
+
+ if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k))
+ params.toolChainAbi = tc->targetAbi();
+
+ params.executable = runConfig->localExecutableFilePath();
+ params.displayName = runConfig->displayName();
+ params.remoteSetupNeeded = true;
+
+ Debugger::DebuggerRunConfigurationAspect *aspect
+ = runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
+ if (aspect->useQmlDebugger()) {
+ BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(runConfig->target()->kit());
+ if (device) {
+ params.qmlServerAddress = device->sshParameters().host;
+ params.qmlServerPort = aspect->qmlDebugServerPort();
+ params.languages |= Debugger::QmlLanguage;
+ }
+ }
+ if (aspect->useCppDebugger())
+ params.languages |= Debugger::CppLanguage;
+
+ if (const ProjectExplorer::Project *project = runConfig->target()->project()) {
+ params.projectSourceDirectory = project->projectDirectory().toString();
+ if (const ProjectExplorer::BuildConfiguration *buildConfig = runConfig->target()->activeBuildConfiguration())
+ params.projectBuildDirectory = buildConfig->buildDirectory().toString();
+ params.projectSourceFiles = project->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
+ }
+
+ BlackBerryQtVersion *qtVersion =
+ dynamic_cast<BlackBerryQtVersion *>(QtSupport::QtKitInformation::qtVersion(k));
+ if (qtVersion)
+ params.solibSearchPath = QnxUtils::searchPaths(qtVersion);
+
+ return params;
+}
+
ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfiguration,
ProjectExplorer::RunMode mode, QString *errorMessage)
{
@@ -161,7 +208,7 @@ ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(ProjectExplorer
return runControl;
}
Debugger::DebuggerRunControl * const runControl =
- Debugger::DebuggerRunControlFactory::doCreate(startParameters(rc), runConfiguration, errorMessage);
+ Debugger::DebuggerRunControlFactory::doCreate(startParameters(rc), errorMessage);
if (!runControl)
return 0;
@@ -169,50 +216,3 @@ ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(ProjectExplorer
m_activeRunControls[rc->key()] = runControl;
return runControl;
}
-
-Debugger::DebuggerStartParameters BlackBerryRunControlFactory::startParameters(
- const BlackBerryRunConfiguration *runConfig)
-{
- Debugger::DebuggerStartParameters params;
- ProjectExplorer::Target *target = runConfig->target();
- ProjectExplorer::Kit *k = target->kit();
-
- params.startMode = Debugger::AttachToRemoteServer;
- params.debuggerCommand = Debugger::DebuggerKitInformation::debuggerCommand(k).toString();
- params.sysRoot = ProjectExplorer::SysRootKitInformation::sysRoot(k).toString();
- params.useCtrlCStub = true;
-
- if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k))
- params.toolChainAbi = tc->targetAbi();
-
- params.executable = runConfig->localExecutableFilePath();
- params.displayName = runConfig->displayName();
- params.remoteSetupNeeded = true;
-
- Debugger::DebuggerRunConfigurationAspect *aspect
- = runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
- if (aspect->useQmlDebugger()) {
- BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(runConfig->target()->kit());
- if (device) {
- params.qmlServerAddress = device->sshParameters().host;
- params.qmlServerPort = aspect->qmlDebugServerPort();
- params.languages |= Debugger::QmlLanguage;
- }
- }
- if (aspect->useCppDebugger())
- params.languages |= Debugger::CppLanguage;
-
- if (const ProjectExplorer::Project *project = runConfig->target()->project()) {
- params.projectSourceDirectory = project->projectDirectory().toString();
- if (const ProjectExplorer::BuildConfiguration *buildConfig = runConfig->target()->activeBuildConfiguration())
- params.projectBuildDirectory = buildConfig->buildDirectory().toString();
- params.projectSourceFiles = project->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
- }
-
- BlackBerryQtVersion *qtVersion =
- dynamic_cast<BlackBerryQtVersion *>(QtSupport::QtKitInformation::qtVersion(k));
- if (qtVersion)
- params.solibSearchPath = QnxUtils::searchPaths(qtVersion);
-
- return params;
-}
diff --git a/src/plugins/qnx/blackberryruncontrolfactory.h b/src/plugins/qnx/blackberryruncontrolfactory.h
index 9aa99515de..b36a485ece 100644
--- a/src/plugins/qnx/blackberryruncontrolfactory.h
+++ b/src/plugins/qnx/blackberryruncontrolfactory.h
@@ -58,8 +58,6 @@ public:
QString *errorMessage);
private:
- static Debugger::DebuggerStartParameters startParameters( const BlackBerryRunConfiguration *runConfig);
-
mutable QMap<QString, QPointer<ProjectExplorer::RunControl> > m_activeRunControls;
};
diff --git a/src/plugins/qnx/qnxattachdebugsupport.cpp b/src/plugins/qnx/qnxattachdebugsupport.cpp
index 7ad528272b..281a10b615 100644
--- a/src/plugins/qnx/qnxattachdebugsupport.cpp
+++ b/src/plugins/qnx/qnxattachdebugsupport.cpp
@@ -132,7 +132,7 @@ void QnxAttachDebugSupport::attachToProcess()
sp.solibSearchPath = QnxUtils::searchPaths(qtVersion);
QString errorMessage;
- Debugger::DebuggerRunControl * const runControl = Debugger::DebuggerRunControlFactory::doCreate(sp, 0, &errorMessage);
+ Debugger::DebuggerRunControl * const runControl = Debugger::DebuggerRunControlFactory::doCreate(sp, &errorMessage);
if (!errorMessage.isEmpty()) {
handleError(errorMessage);
stopPDebug();
diff --git a/src/plugins/qnx/qnxruncontrolfactory.cpp b/src/plugins/qnx/qnxruncontrolfactory.cpp
index e21cfcf3fd..21e093c103 100644
--- a/src/plugins/qnx/qnxruncontrolfactory.cpp
+++ b/src/plugins/qnx/qnxruncontrolfactory.cpp
@@ -62,7 +62,7 @@ using namespace ProjectExplorer;
using namespace Qnx;
using namespace Qnx::Internal;
-static DebuggerStartParameters createDebuggerStartParameters(const QnxRunConfiguration *runConfig)
+static DebuggerStartParameters createDebuggerStartParameters(QnxRunConfiguration *runConfig)
{
DebuggerStartParameters params;
Target *target = runConfig->target();
@@ -76,6 +76,7 @@ static DebuggerStartParameters createDebuggerStartParameters(const QnxRunConfigu
params.debuggerCommand = DebuggerKitInformation::debuggerCommand(k).toString();
params.sysRoot = SysRootKitInformation::sysRoot(k).toString();
params.useCtrlCStub = true;
+ params.runConfiguration = runConfig;
if (ToolChain *tc = ToolChainKitInformation::toolChain(k))
params.toolChainAbi = tc->targetAbi();
@@ -179,7 +180,7 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mo
return new QnxRunControl(rc);
case DebugRunMode: {
const DebuggerStartParameters params = createDebuggerStartParameters(rc);
- DebuggerRunControl * const runControl = DebuggerRunControlFactory::doCreate(params, rc, errorMessage);
+ DebuggerRunControl * const runControl = DebuggerRunControlFactory::doCreate(params, errorMessage);
if (!runControl)
return 0;
diff --git a/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp b/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp
index c1074a5b89..32130ccc93 100644
--- a/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp
+++ b/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp
@@ -106,8 +106,9 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Ru
DebuggerStartParameters params = LinuxDeviceDebugSupport::startParameters(rc);
if (mode == DebugRunModeWithBreakOnMain)
params.breakOnMain = true;
+ params.runConfiguration = rc;
DebuggerRunControl * const runControl
- = DebuggerRunControlFactory::doCreate(params, rc, errorMessage);
+ = DebuggerRunControlFactory::doCreate(params, errorMessage);
if (!runControl)
return 0;
LinuxDeviceDebugSupport * const debugSupport =
diff --git a/src/plugins/valgrind/memcheckengine.cpp b/src/plugins/valgrind/memcheckengine.cpp
index d52e6ef6e9..67f17f0315 100644
--- a/src/plugins/valgrind/memcheckengine.cpp
+++ b/src/plugins/valgrind/memcheckengine.cpp
@@ -189,9 +189,10 @@ void MemcheckWithGdbRunControl::startDebugger()
sp.remoteChannel = QString::fromLatin1("| vgdb --pid=%1").arg(valgrindPid);
sp.useContinueInsteadOfRun = true;
sp.expectedSignals << "SIGTRAP";
+ sp.runConfiguration = rc;
QString errorMessage;
- RunControl *gdbRunControl = Debugger::DebuggerRunControlFactory::doCreate(sp, rc, &errorMessage);
+ RunControl *gdbRunControl = Debugger::DebuggerRunControlFactory::doCreate(sp, &errorMessage);
QTC_ASSERT(gdbRunControl, return);
connect(gdbRunControl, &RunControl::finished,
gdbRunControl, &RunControl::deleteLater);
diff --git a/src/plugins/winrt/winrtdebugsupport.cpp b/src/plugins/winrt/winrtdebugsupport.cpp
index 3a8abbc15b..2961af61b0 100644
--- a/src/plugins/winrt/winrtdebugsupport.cpp
+++ b/src/plugins/winrt/winrtdebugsupport.cpp
@@ -119,8 +119,9 @@ RunControl *WinRtDebugSupport::createDebugRunControl(WinRtRunConfiguration *runC
return 0;
}
server.close();
+ params.runConfiguration = runConfig;
Debugger::DebuggerRunControl *debugRunControl
- = DebuggerRunControlFactory::doCreate(params, runConfig, errorMessage);
+ = DebuggerRunControlFactory::doCreate(params, errorMessage);
runner->setRunControl(debugRunControl);
new WinRtDebugSupport(debugRunControl, runner);
return debugRunControl;