forked from qt-creator/qt-creator
Debugger: Pass RunControl in DebuggerStartParameters
.. to simplify DebuggerRunControlFactory::doCreate() call. Change-Id: I4dd0c224968bb8a388ea7f095b940b66ee606ab1 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user