forked from qt-creator/qt-creator
Debugger: Remove convenience DebuggerRunTool constructors
Use setRunParameters() for now, and individual setters later. Change-Id: If7d044ea249b79ce117897a976659e9302bfc544 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -3710,14 +3710,13 @@ void DebuggerUnitTests::testStateMachine()
|
|||||||
rp.inferior = rc->runnable().as<StandardRunnable>();
|
rp.inferior = rc->runnable().as<StandardRunnable>();
|
||||||
rp.testCase = TestNoBoundsOfCurrentFunction;
|
rp.testCase = TestNoBoundsOfCurrentFunction;
|
||||||
|
|
||||||
auto runControl = new RunControl(rc, ProjectExplorer::Constants::DEBUG_RUN_MODE);
|
auto debugger = DebuggerRunTool::createFromRunConfiguration(rc);
|
||||||
auto runTool = new DebuggerRunTool(runControl, rp);
|
debugger->setRunParameters(rp);
|
||||||
|
|
||||||
connect(runTool, &DebuggerRunTool::stopped, this, [] {
|
connect(debugger, &DebuggerRunTool::stopped,
|
||||||
QTestEventLoop::instance().exitLoop();
|
&QTestEventLoop::instance(), &QTestEventLoop::exitLoop);
|
||||||
});
|
|
||||||
|
|
||||||
ProjectExplorerPlugin::startRunControl(runControl);
|
debugger->startRunControl();
|
||||||
|
|
||||||
QTestEventLoop::instance().enterLoop(5);
|
QTestEventLoop::instance().enterLoop(5);
|
||||||
}
|
}
|
||||||
|
@@ -792,18 +792,6 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl)
|
|||||||
m_runParameters.inferior = r.as<StandardRunnable>();
|
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)
|
void DebuggerRunTool::setRunParameters(const DebuggerRunParameters &rp)
|
||||||
{
|
{
|
||||||
m_runParameters = rp;
|
m_runParameters = rp;
|
||||||
|
@@ -34,19 +34,12 @@
|
|||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
|
|
||||||
class DebuggerStartParameters;
|
|
||||||
|
|
||||||
class DEBUGGER_EXPORT DebuggerRunTool : public ProjectExplorer::RunWorker
|
class DEBUGGER_EXPORT DebuggerRunTool : public ProjectExplorer::RunWorker
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DebuggerRunTool(ProjectExplorer::RunControl *runControl); // Use.
|
explicit DebuggerRunTool(ProjectExplorer::RunControl *runControl);
|
||||||
|
|
||||||
DebuggerRunTool(ProjectExplorer::RunControl *runControl,
|
|
||||||
const DebuggerStartParameters &sp); // Use rarely.
|
|
||||||
DebuggerRunTool(ProjectExplorer::RunControl *runControl,
|
|
||||||
const Internal::DebuggerRunParameters &rp); // FIXME: Don't use.
|
|
||||||
~DebuggerRunTool();
|
~DebuggerRunTool();
|
||||||
|
|
||||||
void setRunParameters(const Internal::DebuggerRunParameters &rp); // FIXME: Don't use.
|
void setRunParameters(const Internal::DebuggerRunParameters &rp); // FIXME: Don't use.
|
||||||
@@ -55,7 +48,7 @@ public:
|
|||||||
Internal::DebuggerEngine *activeEngine() const;
|
Internal::DebuggerEngine *activeEngine() const;
|
||||||
|
|
||||||
static DebuggerRunTool *createFromRunConfiguration(ProjectExplorer::RunConfiguration *runConfig);
|
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 startRunControl();
|
||||||
|
|
||||||
void showMessage(const QString &msg, int channel = LogDebug, int timeout = -1);
|
void showMessage(const QString &msg, int channel = LogDebug, int timeout = -1);
|
||||||
|
@@ -131,11 +131,12 @@ void QnxAttachDebugSupport::attachToProcess()
|
|||||||
sp.solibSearchPath = QnxUtils::searchPaths(qtVersion);
|
sp.solibSearchPath = QnxUtils::searchPaths(qtVersion);
|
||||||
|
|
||||||
auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE);
|
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()),
|
// connect(qobject_cast<Debugger::DebuggerRunTool *>(runControl->toolRunner()),
|
||||||
// &Debugger::DebuggerRunTool::stateChanged,
|
// &Debugger::DebuggerRunTool::stateChanged,
|
||||||
// this, &QnxAttachDebugSupport::handleDebuggerStateChanged);
|
// this, &QnxAttachDebugSupport::handleDebuggerStateChanged);
|
||||||
ProjectExplorerPlugin::startRunControl(runControl);
|
debugger->startRunControl();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QnxAttachDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState state)
|
void QnxAttachDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState state)
|
||||||
|
Reference in New Issue
Block a user