forked from qt-creator/qt-creator
debugger: more RunControl related cleanup
This commit is contained in:
@@ -109,6 +109,7 @@ public:
|
|||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
QString executable;
|
QString executable;
|
||||||
|
QString displayName;
|
||||||
QString coreFile;
|
QString coreFile;
|
||||||
QStringList processArgs;
|
QStringList processArgs;
|
||||||
QStringList environment;
|
QStringList environment;
|
||||||
|
@@ -52,6 +52,7 @@
|
|||||||
#include <coreplugin/findplaceholder.h>
|
#include <coreplugin/findplaceholder.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/icorelistener.h>
|
#include <coreplugin/icorelistener.h>
|
||||||
|
#include <coreplugin/manhattanstyle.h>
|
||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
#include <coreplugin/minisplitter.h>
|
#include <coreplugin/minisplitter.h>
|
||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
@@ -66,11 +67,11 @@
|
|||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <coreplugin/manhattanstyle.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/session.h>
|
#include <projectexplorer/session.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
|
|
||||||
#include <texteditor/basetexteditor.h>
|
#include <texteditor/basetexteditor.h>
|
||||||
#include <texteditor/basetextmark.h>
|
#include <texteditor/basetextmark.h>
|
||||||
@@ -1520,6 +1521,7 @@ void DebuggerPlugin::attachCore(const QString &core, const QString &exe)
|
|||||||
const DebuggerStartParametersPtr sp(new DebuggerStartParameters);
|
const DebuggerStartParametersPtr sp(new DebuggerStartParameters);
|
||||||
sp->executable = exe;
|
sp->executable = exe;
|
||||||
sp->coreFile = core;
|
sp->coreFile = core;
|
||||||
|
sp->displayName = tr("Core file: \"%1\"").arg(core);
|
||||||
sp->startMode = AttachCore;
|
sp->startMode = AttachCore;
|
||||||
if (RunControl *runControl = m_debuggerRunControlFactory->create(sp))
|
if (RunControl *runControl = m_debuggerRunControlFactory->create(sp))
|
||||||
ProjectExplorerPlugin::instance()->
|
ProjectExplorerPlugin::instance()->
|
||||||
@@ -1560,6 +1562,7 @@ void DebuggerPlugin::startRemoteApplication()
|
|||||||
sp->remoteChannel = dlg.remoteChannel();
|
sp->remoteChannel = dlg.remoteChannel();
|
||||||
sp->remoteArchitecture = dlg.remoteArchitecture();
|
sp->remoteArchitecture = dlg.remoteArchitecture();
|
||||||
sp->executable = dlg.localExecutable();
|
sp->executable = dlg.localExecutable();
|
||||||
|
sp->displayName = dlg.localExecutable();
|
||||||
sp->debuggerCommand = dlg.debugger(); // Override toolchain-detection.
|
sp->debuggerCommand = dlg.debugger(); // Override toolchain-detection.
|
||||||
if (!sp->debuggerCommand.isEmpty())
|
if (!sp->debuggerCommand.isEmpty())
|
||||||
sp->toolChainType = ProjectExplorer::ToolChain::INVALID;
|
sp->toolChainType = ProjectExplorer::ToolChain::INVALID;
|
||||||
|
@@ -35,6 +35,7 @@
|
|||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
|
#include <projectexplorer/applicationrunconfiguration.h> // For LocalApplication*
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
@@ -90,6 +91,7 @@ static DebuggerStartParametersPtr localStartParameters(RunConfiguration *runConf
|
|||||||
sp->useTerminal = rc->runMode() == LocalApplicationRunConfiguration::Console;
|
sp->useTerminal = rc->runMode() == LocalApplicationRunConfiguration::Console;
|
||||||
sp->dumperLibrary = rc->dumperLibrary();
|
sp->dumperLibrary = rc->dumperLibrary();
|
||||||
sp->dumperLibraryLocations = rc->dumperLibraryLocations();
|
sp->dumperLibraryLocations = rc->dumperLibraryLocations();
|
||||||
|
sp->displayName = rc->displayName();
|
||||||
|
|
||||||
// Find qtInstallPath.
|
// Find qtInstallPath.
|
||||||
QString qmakePath = DebuggingHelperLibrary::findSystemQt(rc->environment());
|
QString qmakePath = DebuggingHelperLibrary::findSystemQt(rc->environment());
|
||||||
@@ -112,12 +114,12 @@ RunControl *DebuggerRunControlFactory::create(RunConfiguration *runConfiguration
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(mode == ProjectExplorer::Constants::DEBUGMODE, return 0);
|
QTC_ASSERT(mode == ProjectExplorer::Constants::DEBUGMODE, return 0);
|
||||||
DebuggerStartParametersPtr sp = localStartParameters(runConfiguration);
|
DebuggerStartParametersPtr sp = localStartParameters(runConfiguration);
|
||||||
return new DebuggerRunControl(m_manager, sp, runConfiguration);
|
return new DebuggerRunControl(m_manager, sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
RunControl *DebuggerRunControlFactory::create(const DebuggerStartParametersPtr &sp)
|
RunControl *DebuggerRunControlFactory::create(const DebuggerStartParametersPtr &sp)
|
||||||
{
|
{
|
||||||
return new DebuggerRunControl(m_manager, sp, 0);
|
return new DebuggerRunControl(m_manager, sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *DebuggerRunControlFactory::createConfigurationWidget(RunConfiguration *runConfiguration)
|
QWidget *DebuggerRunControlFactory::createConfigurationWidget(RunConfiguration *runConfiguration)
|
||||||
@@ -136,31 +138,11 @@ QWidget *DebuggerRunControlFactory::createConfigurationWidget(RunConfiguration *
|
|||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager,
|
DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager,
|
||||||
const DebuggerStartParametersPtr &startParameters,
|
const DebuggerStartParametersPtr &startParameters)
|
||||||
RunConfiguration *runConfiguration)
|
: RunControl(0, ProjectExplorer::Constants::DEBUGMODE),
|
||||||
: RunControl(runConfiguration, ProjectExplorer::Constants::DEBUGMODE),
|
|
||||||
m_startParameters(startParameters),
|
m_startParameters(startParameters),
|
||||||
m_manager(manager),
|
m_manager(manager),
|
||||||
m_running(false)
|
m_running(false)
|
||||||
{
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (m_startParameters->environment.empty())
|
|
||||||
m_startParameters->environment = ProjectExplorer::Environment().toStringList();
|
|
||||||
m_startParameters->useTerminal = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString DebuggerRunControl::displayName() const
|
|
||||||
{
|
|
||||||
return tr("Core file: \"%1\"").arg(m_startParameters->coreFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerRunControl::setCustomEnvironment(ProjectExplorer::Environment env)
|
|
||||||
{
|
|
||||||
m_startParameters->environment = env.toStringList();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerRunControl::init()
|
|
||||||
{
|
{
|
||||||
connect(m_manager, SIGNAL(debuggingFinished()),
|
connect(m_manager, SIGNAL(debuggingFinished()),
|
||||||
this, SLOT(debuggingFinished()),
|
this, SLOT(debuggingFinished()),
|
||||||
@@ -175,6 +157,24 @@ void DebuggerRunControl::init()
|
|||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
connect(this, SIGNAL(stopRequested()),
|
connect(this, SIGNAL(stopRequested()),
|
||||||
m_manager, SLOT(exitDebugger()));
|
m_manager, SLOT(exitDebugger()));
|
||||||
|
|
||||||
|
if (m_startParameters->environment.empty())
|
||||||
|
m_startParameters->environment = ProjectExplorer::Environment().toStringList();
|
||||||
|
m_startParameters->useTerminal = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString DebuggerRunControl::displayName() const
|
||||||
|
{
|
||||||
|
return m_startParameters->displayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DebuggerRunControl::setCustomEnvironment(ProjectExplorer::Environment env)
|
||||||
|
{
|
||||||
|
m_startParameters->environment = env.toStringList();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DebuggerRunControl::init()
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerRunControl::start()
|
void DebuggerRunControl::start()
|
||||||
|
@@ -33,7 +33,10 @@
|
|||||||
#include "debuggermanager.h"
|
#include "debuggermanager.h"
|
||||||
#include "debugger_global.h"
|
#include "debugger_global.h"
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
#include <projectexplorer/applicationrunconfiguration.h>
|
|
||||||
|
namespace ProjectExplorer {
|
||||||
|
class Environment;
|
||||||
|
}
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -59,7 +62,6 @@ public:
|
|||||||
ProjectExplorer::RunControl *create(const DebuggerStartParametersPtr &sp);
|
ProjectExplorer::RunControl *create(const DebuggerStartParametersPtr &sp);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DebuggerStartParametersPtr m_startParameters;
|
|
||||||
DebuggerManager *m_manager;
|
DebuggerManager *m_manager;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -70,11 +72,8 @@ class DEBUGGER_EXPORT DebuggerRunControl
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// startParameters are primary. If the user code has a RunConfiguration
|
DebuggerRunControl(DebuggerManager *manager,
|
||||||
// (like the 'standard' LocalRunConfiguration), it should pass it so
|
const DebuggerStartParametersPtr &startParameters);
|
||||||
// we can pass it down to the ProjectExplorer::RunControl constructor.
|
|
||||||
DebuggerRunControl(DebuggerManager *manager, const DebuggerStartParametersPtr &startParameters,
|
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
|
||||||
|
|
||||||
void setCustomEnvironment(ProjectExplorer::Environment env);
|
void setCustomEnvironment(ProjectExplorer::Environment env);
|
||||||
|
|
||||||
|
@@ -378,6 +378,9 @@ void QmlEngine::startDebugging()
|
|||||||
void QmlEngine::postCommand(const QByteArray &cmd,
|
void QmlEngine::postCommand(const QByteArray &cmd,
|
||||||
QmlCommandCallback callback, const char *callbackName)
|
QmlCommandCallback callback, const char *callbackName)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(cmd);
|
||||||
|
Q_UNUSED(callback);
|
||||||
|
Q_UNUSED(callbackName);
|
||||||
/*
|
/*
|
||||||
static int token = 20;
|
static int token = 20;
|
||||||
++token;
|
++token;
|
||||||
@@ -411,6 +414,7 @@ void QmlEngine::postCommand(const QByteArray &cmd,
|
|||||||
// already too late when we get a flow control packet
|
// already too late when we get a flow control packet
|
||||||
void QmlEngine::enqueueCommand(const QmlCommand &cmd)
|
void QmlEngine::enqueueCommand(const QmlCommand &cmd)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(cmd);
|
||||||
/*
|
/*
|
||||||
#ifdef USE_CONGESTION_CONTROL
|
#ifdef USE_CONGESTION_CONTROL
|
||||||
// congestion controled
|
// congestion controled
|
||||||
|
Reference in New Issue
Block a user