forked from qt-creator/qt-creator
Debugger: Remove use of non-base RunControl object
Change-Id: I72c6f66662a82b29d831631fdb2f152d8541cf09 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -101,8 +101,8 @@ static const char *engineTypeName(DebuggerEngineType et)
|
|||||||
return "No engine";
|
return "No engine";
|
||||||
}
|
}
|
||||||
|
|
||||||
DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration, DebuggerEngine *engine)
|
DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfig, DebuggerEngine *engine)
|
||||||
: RunControl(runConfiguration, DebugRunMode),
|
: RunControl(runConfig, DebugRunMode),
|
||||||
m_engine(engine),
|
m_engine(engine),
|
||||||
m_running(false)
|
m_running(false)
|
||||||
{
|
{
|
||||||
@@ -283,27 +283,27 @@ DebuggerRunControlFactory::DebuggerRunControlFactory(QObject *parent)
|
|||||||
: IRunControlFactory(parent)
|
: IRunControlFactory(parent)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
bool DebuggerRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const
|
bool DebuggerRunControlFactory::canRun(RunConfiguration *runConfig, RunMode mode) const
|
||||||
{
|
{
|
||||||
return (mode == DebugRunMode || mode == DebugRunModeWithBreakOnMain)
|
return (mode == DebugRunMode || mode == DebugRunModeWithBreakOnMain)
|
||||||
&& qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
&& qobject_cast<LocalApplicationRunConfiguration *>(runConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DebuggerRunControlFactory::fillParametersFromLocalRunConfiguration
|
bool DebuggerRunControlFactory::fillParametersFromLocalRunConfiguration
|
||||||
(DebuggerStartParameters *sp, const RunConfiguration *runConfiguration, QString *errorMessage)
|
(DebuggerStartParameters *sp, const RunConfiguration *runConfig, QString *errorMessage)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(runConfiguration, return false);
|
QTC_ASSERT(runConfig, return false);
|
||||||
auto rc = qobject_cast<const LocalApplicationRunConfiguration *>(runConfiguration);
|
EnvironmentAspect *environmentAspect = runConfig->extraAspect<EnvironmentAspect>();
|
||||||
QTC_ASSERT(rc, return false);
|
|
||||||
EnvironmentAspect *environmentAspect = rc->extraAspect<EnvironmentAspect>();
|
|
||||||
QTC_ASSERT(environmentAspect, return false);
|
QTC_ASSERT(environmentAspect, return false);
|
||||||
|
|
||||||
Target *target = runConfiguration->target();
|
Target *target = runConfig->target();
|
||||||
Kit *kit = target ? target->kit() : KitManager::defaultKit();
|
Kit *kit = target ? target->kit() : KitManager::defaultKit();
|
||||||
if (!fillParametersFromKit(sp, kit, errorMessage))
|
if (!fillParametersFromKit(sp, kit, errorMessage))
|
||||||
return false;
|
return false;
|
||||||
sp->environment = environmentAspect->environment();
|
sp->environment = environmentAspect->environment();
|
||||||
|
|
||||||
|
auto rc = qobject_cast<const LocalApplicationRunConfiguration *>(runConfig);
|
||||||
|
QTC_ASSERT(rc, return false);
|
||||||
// Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...)
|
// Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...)
|
||||||
sp->workingDirectory = FileUtils::normalizePathName(rc->workingDirectory());
|
sp->workingDirectory = FileUtils::normalizePathName(rc->workingDirectory());
|
||||||
|
|
||||||
@@ -323,7 +323,7 @@ bool DebuggerRunControlFactory::fillParametersFromLocalRunConfiguration
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DebuggerRunConfigurationAspect *debuggerAspect = runConfiguration->extraAspect<DebuggerRunConfigurationAspect>();
|
DebuggerRunConfigurationAspect *debuggerAspect = runConfig->extraAspect<DebuggerRunConfigurationAspect>();
|
||||||
QTC_ASSERT(debuggerAspect, return false);
|
QTC_ASSERT(debuggerAspect, return false);
|
||||||
sp->multiProcess = debuggerAspect->useMultiProcess();
|
sp->multiProcess = debuggerAspect->useMultiProcess();
|
||||||
|
|
||||||
@@ -331,8 +331,7 @@ bool DebuggerRunControlFactory::fillParametersFromLocalRunConfiguration
|
|||||||
sp->languages |= CppLanguage;
|
sp->languages |= CppLanguage;
|
||||||
|
|
||||||
if (debuggerAspect->useQmlDebugger()) {
|
if (debuggerAspect->useQmlDebugger()) {
|
||||||
const IDevice::ConstPtr device =
|
const IDevice::ConstPtr device = DeviceKitInformation::device(runConfig->target()->kit());
|
||||||
DeviceKitInformation::device(runConfiguration->target()->kit());
|
|
||||||
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return sp);
|
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return sp);
|
||||||
QTcpServer server;
|
QTcpServer server;
|
||||||
const bool canListen = server.listen(QHostAddress::LocalHost)
|
const bool canListen = server.listen(QHostAddress::LocalHost)
|
||||||
@@ -356,7 +355,7 @@ bool DebuggerRunControlFactory::fillParametersFromLocalRunConfiguration
|
|||||||
}
|
}
|
||||||
|
|
||||||
sp->startMode = StartInternal;
|
sp->startMode = StartInternal;
|
||||||
sp->displayName = rc->displayName();
|
sp->displayName = runConfig->displayName();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -82,7 +82,7 @@ signals:
|
|||||||
private:
|
private:
|
||||||
void handleFinished();
|
void handleFinished();
|
||||||
friend class DebuggerRunControlFactory;
|
friend class DebuggerRunControlFactory;
|
||||||
DebuggerRunControl(ProjectExplorer::RunConfiguration *runConfiguration,
|
DebuggerRunControl(ProjectExplorer::RunConfiguration *runConfig,
|
||||||
Internal::DebuggerEngine *engine);
|
Internal::DebuggerEngine *engine);
|
||||||
|
|
||||||
Internal::DebuggerEngine *m_engine;
|
Internal::DebuggerEngine *m_engine;
|
||||||
@@ -97,11 +97,11 @@ public:
|
|||||||
|
|
||||||
// FIXME: Used by qmljsinspector.cpp:469
|
// FIXME: Used by qmljsinspector.cpp:469
|
||||||
ProjectExplorer::RunControl *create(
|
ProjectExplorer::RunControl *create(
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
ProjectExplorer::RunConfiguration *runConfig,
|
||||||
ProjectExplorer::RunMode mode,
|
ProjectExplorer::RunMode mode,
|
||||||
QString *errorMessage);
|
QString *errorMessage);
|
||||||
|
|
||||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
bool canRun(ProjectExplorer::RunConfiguration *runConfig,
|
||||||
ProjectExplorer::RunMode mode) const;
|
ProjectExplorer::RunMode mode) const;
|
||||||
|
|
||||||
static Internal::DebuggerEngine *createEngine(DebuggerEngineType et,
|
static Internal::DebuggerEngine *createEngine(DebuggerEngineType et,
|
||||||
@@ -112,7 +112,7 @@ public:
|
|||||||
const ProjectExplorer::Kit *kit, QString *errorMessage = 0);
|
const ProjectExplorer::Kit *kit, QString *errorMessage = 0);
|
||||||
|
|
||||||
static bool fillParametersFromLocalRunConfiguration(DebuggerStartParameters *sp,
|
static bool fillParametersFromLocalRunConfiguration(DebuggerStartParameters *sp,
|
||||||
const ProjectExplorer::RunConfiguration *rc, QString *errorMessage = 0);
|
const ProjectExplorer::RunConfiguration *runConfig, QString *errorMessage = 0);
|
||||||
|
|
||||||
static DebuggerRunControl *createAndScheduleRun(const DebuggerStartParameters &sp);
|
static DebuggerRunControl *createAndScheduleRun(const DebuggerStartParameters &sp);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user