Commit e44d16e3 authored by hjk's avatar hjk

Debugger: Remove convenience DebuggerRunTool constructors

Use setRunParameters() for now, and individual setters later.

Change-Id: If7d044ea249b79ce117897a976659e9302bfc544
Reviewed-by: default avatarhjk <hjk@qt.io>
parent 440f2ba0
......@@ -3710,14 +3710,13 @@ void DebuggerUnitTests::testStateMachine()
rp.inferior = rc->runnable().as<StandardRunnable>();
rp.testCase = TestNoBoundsOfCurrentFunction;
auto runControl = new RunControl(rc, ProjectExplorer::Constants::DEBUG_RUN_MODE);
auto runTool = new DebuggerRunTool(runControl, rp);
auto debugger = DebuggerRunTool::createFromRunConfiguration(rc);
debugger->setRunParameters(rp);
connect(runTool, &DebuggerRunTool::stopped, this, [] {
QTestEventLoop::instance().exitLoop();
});
connect(debugger, &DebuggerRunTool::stopped,
&QTestEventLoop::instance(), &QTestEventLoop::exitLoop);
ProjectExplorerPlugin::startRunControl(runControl);
debugger->startRunControl();
QTestEventLoop::instance().enterLoop(5);
}
......
......@@ -792,18 +792,6 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl)
m_runParameters.inferior = r.as<StandardRunnable>();
}
DebuggerRunTool::DebuggerRunTool(RunControl *runControl, const DebuggerStartParameters &sp)
: DebuggerRunTool(runControl)
{
setRunParameters(sp);
}
DebuggerRunTool::DebuggerRunTool(RunControl *runControl, const DebuggerRunParameters &rp)
: DebuggerRunTool(runControl)
{
setRunParameters(rp);
}
void DebuggerRunTool::setRunParameters(const DebuggerRunParameters &rp)
{
m_runParameters = rp;
......
......@@ -34,19 +34,12 @@
namespace Debugger {
class DebuggerStartParameters;
class DEBUGGER_EXPORT DebuggerRunTool : public ProjectExplorer::RunWorker
{
Q_OBJECT
public:
DebuggerRunTool(ProjectExplorer::RunControl *runControl); // Use.
DebuggerRunTool(ProjectExplorer::RunControl *runControl,
const DebuggerStartParameters &sp); // Use rarely.
DebuggerRunTool(ProjectExplorer::RunControl *runControl,
const Internal::DebuggerRunParameters &rp); // FIXME: Don't use.
explicit DebuggerRunTool(ProjectExplorer::RunControl *runControl);
~DebuggerRunTool();
void setRunParameters(const Internal::DebuggerRunParameters &rp); // FIXME: Don't use.
......@@ -55,7 +48,7 @@ public:
Internal::DebuggerEngine *activeEngine() const;
static DebuggerRunTool *createFromRunConfiguration(ProjectExplorer::RunConfiguration *runConfig);
static DebuggerRunTool *createFromKit(ProjectExplorer::Kit *kit);
static DebuggerRunTool *createFromKit(ProjectExplorer::Kit *kit); // Avoid, it's guessing.
void startRunControl();
void showMessage(const QString &msg, int channel = LogDebug, int timeout = -1);
......
......@@ -131,11 +131,12 @@ void QnxAttachDebugSupport::attachToProcess()
sp.solibSearchPath = QnxUtils::searchPaths(qtVersion);
auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE);
(void) new Debugger::DebuggerRunTool(runControl, sp);
auto debugger = new Debugger::DebuggerRunTool(runControl);
debugger->setRunParameters(sp);
// connect(qobject_cast<Debugger::DebuggerRunTool *>(runControl->toolRunner()),
// &Debugger::DebuggerRunTool::stateChanged,
// this, &QnxAttachDebugSupport::handleDebuggerStateChanged);
ProjectExplorerPlugin::startRunControl(runControl);
debugger->startRunControl();
}
void QnxAttachDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState state)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment