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