Commit dbdecb2f authored by hjk's avatar hjk

debugger: more RunControl related cleanup

parent cbfd3203
......@@ -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,14 +138,25 @@ 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();
connect(m_manager, SIGNAL(debuggingFinished()),
this, SLOT(debuggingFinished()),
Qt::QueuedConnection);
connect(m_manager, SIGNAL(applicationOutputAvailable(QString, bool)),
this, SLOT(slotAddToOutputWindowInline(QString, bool)),
Qt::QueuedConnection);
connect(m_manager, SIGNAL(messageAvailable(QString, bool)),
this, SLOT(slotMessageAvailable(QString, bool)));
connect(m_manager, SIGNAL(inferiorPidChanged(qint64)),
this, SLOT(bringApplicationToForeground(qint64)),
Qt::QueuedConnection);
connect(this, SIGNAL(stopRequested()),
m_manager, SLOT(exitDebugger()));
if (m_startParameters->environment.empty())
m_startParameters->environment = ProjectExplorer::Environment().toStringList();
......@@ -152,7 +165,7 @@ DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager,
QString DebuggerRunControl::displayName() const
{
return tr("Core file: \"%1\"").arg(m_startParameters->coreFile);
return m_startParameters->displayName;
}
void DebuggerRunControl::setCustomEnvironment(ProjectExplorer::Environment env)
......@@ -162,19 +175,6 @@ void DebuggerRunControl::setCustomEnvironment(ProjectExplorer::Environment env)
void DebuggerRunControl::init()
{
connect(m_manager, SIGNAL(debuggingFinished()),
this, SLOT(debuggingFinished()),
Qt::QueuedConnection);
connect(m_manager, SIGNAL(applicationOutputAvailable(QString, bool)),
this, SLOT(slotAddToOutputWindowInline(QString, bool)),
Qt::QueuedConnection);
connect(m_manager, SIGNAL(messageAvailable(QString, bool)),
this, SLOT(slotMessageAvailable(QString, bool)));
connect(m_manager, SIGNAL(inferiorPidChanged(qint64)),
this, SLOT(bringApplicationToForeground(qint64)),
Qt::QueuedConnection);
connect(this, SIGNAL(stopRequested()),
m_manager, SLOT(exitDebugger()));
}
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
......
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