2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
**
|
2012-01-26 18:33:46 +01:00
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-07-19 12:26:56 +02:00
|
|
|
** Contact: http://www.qt-project.org/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
**
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
**
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "debuggerrunner.h"
|
2011-01-10 10:35:41 +01:00
|
|
|
#include "debuggerruncontrolfactory.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
#include "debuggeractions.h"
|
2011-04-21 15:52:51 +02:00
|
|
|
#include "debuggerinternalconstants.h"
|
2010-11-10 11:39:01 +01:00
|
|
|
#include "debuggercore.h"
|
2010-06-16 11:08:54 +02:00
|
|
|
#include "debuggerengine.h"
|
2010-12-02 17:43:14 +01:00
|
|
|
#include "debuggermainwindow.h"
|
2010-06-16 11:08:54 +02:00
|
|
|
#include "debuggerplugin.h"
|
|
|
|
#include "debuggerstringutils.h"
|
2011-01-10 10:14:23 +01:00
|
|
|
#include "debuggerstartparameters.h"
|
2012-04-24 15:49:09 +02:00
|
|
|
#include "debuggerprofileinformation.h"
|
2010-10-08 12:14:51 +02:00
|
|
|
#include "lldb/lldbenginehost.h"
|
2011-02-11 15:00:13 +01:00
|
|
|
#include "debuggertooltipmanager.h"
|
2010-06-15 09:13:22 +02:00
|
|
|
|
2010-06-22 12:28:05 +02:00
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
# include "peutils.h"
|
2011-04-19 11:07:34 +02:00
|
|
|
# include <utils/winutils.h>
|
2010-06-22 12:28:05 +02:00
|
|
|
#endif
|
|
|
|
|
2011-02-01 18:36:00 +01:00
|
|
|
#include <projectexplorer/abi.h>
|
2012-08-15 13:21:37 +02:00
|
|
|
#include <projectexplorer/applicationrunconfiguration.h> // For LocalApplication*
|
|
|
|
#include <projectexplorer/buildconfiguration.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <projectexplorer/project.h>
|
2012-08-15 13:21:37 +02:00
|
|
|
#include <projectexplorer/projectexplorer.h>
|
2010-02-08 15:50:06 +01:00
|
|
|
#include <projectexplorer/target.h>
|
2011-02-25 16:03:22 +01:00
|
|
|
#include <projectexplorer/toolchain.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2011-04-15 12:59:44 +02:00
|
|
|
#include <utils/outputformat.h>
|
2010-09-29 10:32:41 +02:00
|
|
|
#include <utils/synchronousprocess.h>
|
2008-12-09 15:25:01 +01:00
|
|
|
#include <utils/qtcassert.h>
|
2010-08-20 14:19:25 +02:00
|
|
|
#include <utils/fancymainwindow.h>
|
2010-12-15 13:06:39 +01:00
|
|
|
#include <utils/qtcprocess.h>
|
2009-10-08 17:23:27 +02:00
|
|
|
#include <coreplugin/icore.h>
|
2012-02-17 19:05:11 +01:00
|
|
|
#include <coreplugin/helpmanager.h>
|
2008-12-09 15:25:01 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QDir>
|
2012-02-17 19:05:11 +01:00
|
|
|
#include <QCheckBox>
|
|
|
|
#include <QSpinBox>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QDebug>
|
|
|
|
#include <QErrorMessage>
|
2012-02-17 19:05:11 +01:00
|
|
|
#include <QFormLayout>
|
|
|
|
#include <QLabel>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-14 17:23:25 +02:00
|
|
|
using namespace Debugger::Internal;
|
2012-08-09 03:58:37 +02:00
|
|
|
using namespace ProjectExplorer;
|
|
|
|
using namespace Utils;
|
2010-06-14 17:23:25 +02:00
|
|
|
|
2011-02-25 09:34:31 +01:00
|
|
|
enum { debug = 0 };
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
namespace Debugger {
|
2011-01-11 11:06:15 +01:00
|
|
|
namespace Internal {
|
2011-01-12 12:10:12 +01:00
|
|
|
|
2012-08-15 14:33:39 +02:00
|
|
|
DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp, QString *error);
|
|
|
|
DebuggerEngine *createGdbEngine(const DebuggerStartParameters &sp);
|
2011-02-22 18:04:55 +01:00
|
|
|
DebuggerEngine *createScriptEngine(const DebuggerStartParameters &sp);
|
|
|
|
DebuggerEngine *createPdbEngine(const DebuggerStartParameters &sp);
|
2012-08-15 14:33:39 +02:00
|
|
|
DebuggerEngine *createQmlEngine(const DebuggerStartParameters &sp);
|
|
|
|
DebuggerEngine *createQmlCppEngine(const DebuggerStartParameters &sp, QString *error);
|
2011-02-22 18:04:55 +01:00
|
|
|
DebuggerEngine *createLldbEngine(const DebuggerStartParameters &sp);
|
2010-06-16 11:08:54 +02:00
|
|
|
|
2011-02-24 16:50:15 +01:00
|
|
|
static const char *engineTypeName(DebuggerEngineType et)
|
|
|
|
{
|
|
|
|
switch (et) {
|
|
|
|
case Debugger::NoEngineType:
|
|
|
|
break;
|
|
|
|
case Debugger::GdbEngineType:
|
2011-03-14 17:34:27 +01:00
|
|
|
return "Gdb engine";
|
2011-02-24 16:50:15 +01:00
|
|
|
case Debugger::ScriptEngineType:
|
|
|
|
return "Script engine";
|
|
|
|
case Debugger::CdbEngineType:
|
|
|
|
return "Cdb engine";
|
|
|
|
case Debugger::PdbEngineType:
|
2011-03-14 17:34:27 +01:00
|
|
|
return "Pdb engine";
|
2011-02-24 16:50:15 +01:00
|
|
|
case Debugger::QmlEngineType:
|
|
|
|
return "QML engine";
|
|
|
|
case Debugger::QmlCppEngineType:
|
|
|
|
return "QML C++ engine";
|
|
|
|
case Debugger::LldbEngineType:
|
|
|
|
return "LLDB engine";
|
|
|
|
case Debugger::AllEngineTypes:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return "No engine";
|
|
|
|
}
|
|
|
|
|
2012-02-17 19:05:11 +01:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// DebuggerRunConfigWidget
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-06-28 10:00:04 +02:00
|
|
|
class DebuggerRunConfigWidget : public RunConfigWidget
|
2012-02-17 19:05:11 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2012-02-22 15:16:56 +01:00
|
|
|
explicit DebuggerRunConfigWidget(RunConfiguration *runConfiguration);
|
|
|
|
QString displayName() const { return tr("Debugger Settings"); }
|
2012-02-17 19:05:11 +01:00
|
|
|
|
|
|
|
private slots:
|
2012-03-28 09:37:02 +02:00
|
|
|
void useCppDebuggerToggled(bool on);
|
|
|
|
void useQmlDebuggerToggled(bool on);
|
2012-02-22 15:16:56 +01:00
|
|
|
void qmlDebugServerPortChanged(int port);
|
2012-03-28 09:37:02 +02:00
|
|
|
void useMultiProcessToggled(bool on);
|
2012-02-22 15:16:56 +01:00
|
|
|
|
|
|
|
public:
|
2012-02-23 14:41:28 +01:00
|
|
|
DebuggerRunConfigurationAspect *m_aspect; // not owned
|
2012-02-17 19:05:11 +01:00
|
|
|
|
|
|
|
QCheckBox *m_useCppDebugger;
|
|
|
|
QCheckBox *m_useQmlDebugger;
|
|
|
|
QSpinBox *m_debugServerPort;
|
|
|
|
QLabel *m_debugServerPortLabel;
|
|
|
|
QLabel *m_qmlDebuggerInfoLabel;
|
2012-03-28 09:37:02 +02:00
|
|
|
QCheckBox *m_useMultiProcess;
|
2012-02-17 19:05:11 +01:00
|
|
|
};
|
|
|
|
|
2012-02-22 15:16:56 +01:00
|
|
|
DebuggerRunConfigWidget::DebuggerRunConfigWidget(RunConfiguration *runConfiguration)
|
2012-02-17 19:05:11 +01:00
|
|
|
{
|
2012-02-23 14:41:28 +01:00
|
|
|
m_aspect = runConfiguration->debuggerAspect();
|
2012-02-17 19:05:11 +01:00
|
|
|
|
2012-02-22 15:16:56 +01:00
|
|
|
m_useCppDebugger = new QCheckBox(tr("Enable C++"), this);
|
|
|
|
m_useQmlDebugger = new QCheckBox(tr("Enable QML"), this);
|
2012-02-17 19:05:11 +01:00
|
|
|
|
|
|
|
m_debugServerPort = new QSpinBox(this);
|
|
|
|
m_debugServerPort->setMinimum(1);
|
|
|
|
m_debugServerPort->setMaximum(65535);
|
|
|
|
|
2012-02-22 15:16:56 +01:00
|
|
|
m_debugServerPortLabel = new QLabel(tr("Debug port:"), this);
|
2012-02-17 19:05:11 +01:00
|
|
|
m_debugServerPortLabel->setBuddy(m_debugServerPort);
|
|
|
|
|
|
|
|
m_qmlDebuggerInfoLabel = new QLabel(tr("<a href=\""
|
|
|
|
"qthelp://com.nokia.qtcreator/doc/creator-debugging-qml.html"
|
|
|
|
"\">What are the prerequisites?</a>"));
|
|
|
|
|
2012-02-29 12:51:27 +01:00
|
|
|
m_useCppDebugger->setChecked(m_aspect->useCppDebugger());
|
|
|
|
m_useQmlDebugger->setChecked(m_aspect->useQmlDebugger());
|
|
|
|
|
2012-02-23 14:41:28 +01:00
|
|
|
m_debugServerPort->setValue(m_aspect->qmlDebugServerPort());
|
2012-02-22 15:16:56 +01:00
|
|
|
|
2012-03-28 09:37:02 +02:00
|
|
|
static const QByteArray env = qgetenv("QTC_DEBUGGER_MULTIPROCESS");
|
|
|
|
m_useMultiProcess =
|
|
|
|
new QCheckBox(tr("Enable Debugging of Subprocesses"), this);
|
|
|
|
m_useMultiProcess->setChecked(m_aspect->useMultiProcess());
|
|
|
|
m_useMultiProcess->setVisible(env.toInt());
|
|
|
|
|
2012-02-17 19:05:11 +01:00
|
|
|
connect(m_qmlDebuggerInfoLabel, SIGNAL(linkActivated(QString)),
|
2012-02-22 15:16:56 +01:00
|
|
|
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
|
2012-02-17 19:05:11 +01:00
|
|
|
connect(m_useQmlDebugger, SIGNAL(toggled(bool)),
|
2012-02-22 15:16:56 +01:00
|
|
|
SLOT(useQmlDebuggerToggled(bool)));
|
|
|
|
connect(m_useCppDebugger, SIGNAL(toggled(bool)),
|
|
|
|
SLOT(useCppDebuggerToggled(bool)));
|
2012-02-17 19:05:11 +01:00
|
|
|
connect(m_debugServerPort, SIGNAL(valueChanged(int)),
|
2012-02-22 15:16:56 +01:00
|
|
|
SLOT(qmlDebugServerPortChanged(int)));
|
2012-03-28 09:37:02 +02:00
|
|
|
connect(m_useMultiProcess, SIGNAL(toggled(bool)),
|
|
|
|
SLOT(useMultiProcessToggled(bool)));
|
2012-02-22 15:16:56 +01:00
|
|
|
|
2012-02-24 16:03:08 +01:00
|
|
|
if (m_aspect->isDisplaySuppressed())
|
|
|
|
hide();
|
|
|
|
|
2012-02-23 14:41:28 +01:00
|
|
|
if (m_aspect->areQmlDebuggingOptionsSuppressed()) {
|
2012-02-22 15:16:56 +01:00
|
|
|
m_debugServerPortLabel->hide();
|
|
|
|
m_debugServerPort->hide();
|
|
|
|
m_useQmlDebugger->hide();
|
|
|
|
}
|
2012-02-17 19:05:11 +01:00
|
|
|
|
2012-02-24 16:03:08 +01:00
|
|
|
if (m_aspect->areCppDebuggingOptionsSuppressed())
|
|
|
|
m_useCppDebugger->hide();
|
|
|
|
|
2012-02-24 12:29:22 +01:00
|
|
|
if (m_aspect->isQmlDebuggingSpinboxSuppressed()) {
|
|
|
|
m_debugServerPort->hide();
|
|
|
|
m_debugServerPortLabel->hide();
|
|
|
|
}
|
|
|
|
|
2012-02-17 19:05:11 +01:00
|
|
|
QHBoxLayout *qmlLayout = new QHBoxLayout;
|
|
|
|
qmlLayout->setMargin(0);
|
|
|
|
qmlLayout->addWidget(m_useQmlDebugger);
|
|
|
|
qmlLayout->addWidget(m_debugServerPortLabel);
|
|
|
|
qmlLayout->addWidget(m_debugServerPort);
|
|
|
|
qmlLayout->addWidget(m_qmlDebuggerInfoLabel);
|
|
|
|
qmlLayout->addStretch();
|
|
|
|
|
|
|
|
QVBoxLayout *layout = new QVBoxLayout;
|
|
|
|
layout->setMargin(0);
|
|
|
|
layout->addWidget(m_useCppDebugger);
|
|
|
|
layout->addLayout(qmlLayout);
|
2012-03-28 09:37:02 +02:00
|
|
|
layout->addWidget(m_useMultiProcess);
|
2012-02-17 19:05:11 +01:00
|
|
|
setLayout(layout);
|
|
|
|
}
|
|
|
|
|
2012-02-22 15:16:56 +01:00
|
|
|
void DebuggerRunConfigWidget::qmlDebugServerPortChanged(int port)
|
2012-02-17 19:05:11 +01:00
|
|
|
{
|
2012-02-23 14:41:28 +01:00
|
|
|
m_aspect->m_qmlDebugServerPort = port;
|
2012-02-17 19:05:11 +01:00
|
|
|
}
|
|
|
|
|
2012-03-28 09:37:02 +02:00
|
|
|
void DebuggerRunConfigWidget::useCppDebuggerToggled(bool on)
|
2012-02-17 19:05:11 +01:00
|
|
|
{
|
2012-03-28 09:37:02 +02:00
|
|
|
m_aspect->m_useCppDebugger = on;
|
|
|
|
if (!on && !m_useQmlDebugger->isChecked())
|
2012-02-17 19:05:11 +01:00
|
|
|
m_useQmlDebugger->setChecked(true);
|
|
|
|
}
|
|
|
|
|
2012-03-28 09:37:02 +02:00
|
|
|
void DebuggerRunConfigWidget::useQmlDebuggerToggled(bool on)
|
2012-02-17 19:05:11 +01:00
|
|
|
{
|
2012-03-28 09:37:02 +02:00
|
|
|
m_debugServerPort->setEnabled(on);
|
|
|
|
m_debugServerPortLabel->setEnabled(on);
|
2012-02-22 15:16:56 +01:00
|
|
|
|
2012-03-28 09:37:02 +02:00
|
|
|
m_aspect->m_useQmlDebugger = on
|
2012-02-23 14:41:28 +01:00
|
|
|
? DebuggerRunConfigurationAspect::EnableQmlDebugger
|
|
|
|
: DebuggerRunConfigurationAspect::DisableQmlDebugger;
|
2012-03-28 09:37:02 +02:00
|
|
|
if (!on && !m_useCppDebugger->isChecked())
|
2012-02-17 19:05:11 +01:00
|
|
|
m_useCppDebugger->setChecked(true);
|
|
|
|
}
|
|
|
|
|
2012-03-28 09:37:02 +02:00
|
|
|
void DebuggerRunConfigWidget::useMultiProcessToggled(bool on)
|
|
|
|
{
|
|
|
|
m_aspect->m_useMultiProcess = on;
|
|
|
|
}
|
|
|
|
|
2010-06-15 08:22:02 +02:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2010-11-26 10:10:00 +01:00
|
|
|
// DebuggerRunControlPrivate
|
2010-06-15 08:22:02 +02:00
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2010-11-26 10:10:00 +01:00
|
|
|
class DebuggerRunControlPrivate
|
|
|
|
{
|
|
|
|
public:
|
2011-02-24 16:50:15 +01:00
|
|
|
explicit DebuggerRunControlPrivate(DebuggerRunControl *parent,
|
|
|
|
RunConfiguration *runConfiguration);
|
2010-09-14 08:34:07 +02:00
|
|
|
|
2010-11-26 10:10:00 +01:00
|
|
|
DebuggerEngineType engineForExecutable(unsigned enabledEngineTypes,
|
|
|
|
const QString &executable);
|
|
|
|
DebuggerEngineType engineForMode(unsigned enabledEngineTypes,
|
|
|
|
DebuggerStartMode mode);
|
|
|
|
|
|
|
|
public:
|
|
|
|
DebuggerRunControl *q;
|
2010-09-14 08:34:07 +02:00
|
|
|
DebuggerEngine *m_engine;
|
|
|
|
const QWeakPointer<RunConfiguration> m_myRunConfiguration;
|
|
|
|
bool m_running;
|
|
|
|
};
|
|
|
|
|
2010-11-26 10:10:00 +01:00
|
|
|
DebuggerRunControlPrivate::DebuggerRunControlPrivate(DebuggerRunControl *parent,
|
2011-02-24 16:50:15 +01:00
|
|
|
RunConfiguration *runConfiguration)
|
2010-11-26 10:10:00 +01:00
|
|
|
: q(parent)
|
|
|
|
, m_engine(0)
|
2010-10-22 11:27:45 +02:00
|
|
|
, m_myRunConfiguration(runConfiguration)
|
2010-08-18 13:54:12 +02:00
|
|
|
, m_running(false)
|
2010-09-14 08:34:07 +02:00
|
|
|
{
|
|
|
|
}
|
2010-08-18 13:54:12 +02:00
|
|
|
|
2010-12-10 09:37:31 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
2010-12-03 16:18:50 +01:00
|
|
|
DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration,
|
2012-08-15 13:21:37 +02:00
|
|
|
const DebuggerStartParameters &sp)
|
2012-06-28 10:00:04 +02:00
|
|
|
: RunControl(runConfiguration, DebugRunMode),
|
2011-01-07 20:10:54 +01:00
|
|
|
d(new DebuggerRunControlPrivate(this, runConfiguration))
|
2009-09-09 18:35:25 +02:00
|
|
|
{
|
2010-12-03 16:18:50 +01:00
|
|
|
connect(this, SIGNAL(finished()), SLOT(handleFinished()));
|
2011-02-24 16:50:15 +01:00
|
|
|
// Create the engine. Could arguably be moved to the factory, but
|
|
|
|
// we still have a derived S60DebugControl. Should rarely fail, though.
|
|
|
|
QString errorMessage;
|
2012-08-15 14:33:39 +02:00
|
|
|
d->m_engine = DebuggerRunControlFactory::createEngine(sp.masterEngineType, sp, &errorMessage);
|
2012-08-15 13:21:37 +02:00
|
|
|
|
2011-02-11 15:00:13 +01:00
|
|
|
if (d->m_engine) {
|
|
|
|
DebuggerToolTipManager::instance()->registerEngine(d->m_engine);
|
|
|
|
} else {
|
2010-10-05 14:30:26 +02:00
|
|
|
debuggingFinished();
|
2012-01-24 15:36:40 +01:00
|
|
|
Core::ICore::showWarningWithOptions(DebuggerRunControl::tr("Debugger"), errorMessage);
|
2010-06-14 18:19:02 +02:00
|
|
|
}
|
2010-04-19 14:21:33 +02:00
|
|
|
}
|
|
|
|
|
2010-12-03 16:18:50 +01:00
|
|
|
DebuggerRunControl::~DebuggerRunControl()
|
|
|
|
{
|
|
|
|
disconnect();
|
|
|
|
if (DebuggerEngine *engine = d->m_engine) {
|
|
|
|
d->m_engine = 0;
|
|
|
|
engine->disconnect();
|
|
|
|
delete engine;
|
|
|
|
}
|
2011-09-16 15:00:41 +02:00
|
|
|
delete d;
|
2010-12-03 16:18:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const DebuggerStartParameters &DebuggerRunControl::startParameters() const
|
|
|
|
{
|
|
|
|
QTC_ASSERT(d->m_engine, return *(new DebuggerStartParameters()));
|
|
|
|
return d->m_engine->startParameters();
|
|
|
|
}
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
QString DebuggerRunControl::displayName() const
|
2010-06-15 08:22:02 +02:00
|
|
|
{
|
2010-09-14 08:34:07 +02:00
|
|
|
QTC_ASSERT(d->m_engine, return QString());
|
|
|
|
return d->m_engine->startParameters().displayName;
|
2010-06-15 08:22:02 +02:00
|
|
|
}
|
|
|
|
|
2011-03-28 19:58:13 +02:00
|
|
|
QIcon DebuggerRunControl::icon() const
|
|
|
|
{
|
2011-12-21 14:02:52 +01:00
|
|
|
return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_DEBUG_SMALL));
|
2011-03-28 19:58:13 +02:00
|
|
|
}
|
|
|
|
|
2012-08-09 03:58:37 +02:00
|
|
|
void DebuggerRunControl::setCustomEnvironment(Environment env)
|
2010-06-15 08:22:02 +02:00
|
|
|
{
|
2010-12-15 09:17:31 +01:00
|
|
|
QTC_ASSERT(d->m_engine, return);
|
2010-10-19 11:14:03 +02:00
|
|
|
d->m_engine->startParameters().environment = env;
|
2010-06-15 08:22:02 +02:00
|
|
|
}
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
void DebuggerRunControl::start()
|
2010-06-15 09:13:22 +02:00
|
|
|
{
|
2010-09-14 08:34:07 +02:00
|
|
|
QTC_ASSERT(d->m_engine, return);
|
2011-04-18 13:01:12 +02:00
|
|
|
// User canceled input dialog asking for executable when working on library project.
|
|
|
|
if (d->m_engine->startParameters().startMode == StartInternal
|
|
|
|
&& d->m_engine->startParameters().executable.isEmpty()) {
|
2012-08-09 03:58:37 +02:00
|
|
|
appendMessage(tr("No executable specified.\n"), ErrorMessageFormat);
|
2011-04-18 13:01:12 +02:00
|
|
|
emit started();
|
|
|
|
emit finished();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-08-08 15:38:05 +02:00
|
|
|
if (d->m_engine->startParameters().startMode == StartInternal) {
|
|
|
|
foreach (const BreakpointModelId &id, debuggerCore()->breakHandler()->allBreakpointIds()) {
|
|
|
|
if (d->m_engine->breakHandler()->breakpointData(id).enabled
|
|
|
|
&& !d->m_engine->acceptsBreakpoint(id)) {
|
|
|
|
|
|
|
|
QString warningMessage =
|
|
|
|
DebuggerPlugin::tr("Some breakpoints cannot be handled by the debugger "
|
|
|
|
"languages currently active, and will be ignored.");
|
|
|
|
|
|
|
|
debuggerCore()->showMessage(warningMessage, LogWarning);
|
|
|
|
|
|
|
|
QErrorMessage *msgBox = new QErrorMessage(debuggerCore()->mainWindow());
|
|
|
|
msgBox->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
msgBox->showMessage(warningMessage);
|
|
|
|
break;
|
|
|
|
}
|
2011-04-28 14:05:28 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-15 09:17:31 +01:00
|
|
|
debuggerCore()->runControlStarted(d->m_engine);
|
2010-08-27 16:22:51 +02:00
|
|
|
|
2010-09-29 10:32:41 +02:00
|
|
|
// We might get a synchronous startFailed() notification on Windows,
|
|
|
|
// when launching the process fails. Emit a proper finished() sequence.
|
2010-06-16 11:08:54 +02:00
|
|
|
emit started();
|
2010-09-29 10:32:41 +02:00
|
|
|
d->m_running = true;
|
|
|
|
|
2010-12-15 09:17:31 +01:00
|
|
|
d->m_engine->startDebugger(this);
|
2010-09-29 10:32:41 +02:00
|
|
|
|
2011-01-07 11:34:25 +01:00
|
|
|
if (d->m_running)
|
2012-08-09 03:58:37 +02:00
|
|
|
appendMessage(tr("Debugging starts\n"), NormalMessageFormat);
|
2010-06-15 11:42:49 +02:00
|
|
|
}
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
void DebuggerRunControl::startFailed()
|
2010-06-15 11:42:49 +02:00
|
|
|
{
|
2012-08-09 03:58:37 +02:00
|
|
|
appendMessage(tr("Debugging has failed\n"), NormalMessageFormat);
|
2010-09-14 08:34:07 +02:00
|
|
|
d->m_running = false;
|
2010-06-16 11:08:54 +02:00
|
|
|
emit finished();
|
2010-12-15 09:17:31 +01:00
|
|
|
d->m_engine->handleStartFailed();
|
2010-06-15 11:42:49 +02:00
|
|
|
}
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
void DebuggerRunControl::handleFinished()
|
2010-06-15 11:42:49 +02:00
|
|
|
{
|
2012-08-09 03:58:37 +02:00
|
|
|
appendMessage(tr("Debugging has finished\n"), NormalMessageFormat);
|
2010-12-15 09:17:31 +01:00
|
|
|
if (d->m_engine)
|
|
|
|
d->m_engine->handleFinished();
|
|
|
|
debuggerCore()->runControlFinished(d->m_engine);
|
2010-06-15 11:42:49 +02:00
|
|
|
}
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
void DebuggerRunControl::showMessage(const QString &msg, int channel)
|
2010-06-15 11:42:49 +02:00
|
|
|
{
|
2010-06-16 11:08:54 +02:00
|
|
|
switch (channel) {
|
|
|
|
case AppOutput:
|
2012-08-09 03:58:37 +02:00
|
|
|
appendMessage(msg, StdOutFormatSameLine);
|
2010-06-16 11:08:54 +02:00
|
|
|
break;
|
|
|
|
case AppError:
|
2012-08-09 03:58:37 +02:00
|
|
|
appendMessage(msg, StdErrFormatSameLine);
|
2010-06-16 11:08:54 +02:00
|
|
|
break;
|
|
|
|
case AppStuff:
|
2012-08-09 03:58:37 +02:00
|
|
|
appendMessage(msg, DebugFormat);
|
2010-06-16 11:08:54 +02:00
|
|
|
break;
|
|
|
|
}
|
2010-06-15 11:42:49 +02:00
|
|
|
}
|
|
|
|
|
2011-01-17 13:52:14 +01:00
|
|
|
bool DebuggerRunControl::promptToStop(bool *optionalPrompt) const
|
2010-06-15 11:42:49 +02:00
|
|
|
{
|
2012-04-17 08:01:25 +02:00
|
|
|
QTC_ASSERT(isRunning(), return true);
|
2010-08-20 14:19:25 +02:00
|
|
|
|
2011-01-17 13:52:14 +01:00
|
|
|
if (optionalPrompt && !*optionalPrompt)
|
|
|
|
return true;
|
|
|
|
|
2010-09-29 12:48:00 +02:00
|
|
|
const QString question = tr("A debugging session is still in progress. "
|
2010-08-20 14:19:25 +02:00
|
|
|
"Terminating the session in the current"
|
|
|
|
" state can leave the target in an inconsistent state."
|
|
|
|
" Would you still like to terminate it?");
|
2011-01-17 13:52:14 +01:00
|
|
|
return showPromptToStopDialog(tr("Close Debugging Session"), question,
|
|
|
|
QString(), QString(), optionalPrompt);
|
2010-08-20 14:19:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
RunControl::StopResult DebuggerRunControl::stop()
|
|
|
|
{
|
2010-09-14 08:34:07 +02:00
|
|
|
QTC_ASSERT(d->m_engine, return StoppedSynchronously);
|
|
|
|
d->m_engine->quitDebugger();
|
2010-08-20 14:19:25 +02:00
|
|
|
return AsynchronousStop;
|
2010-06-15 11:42:49 +02:00
|
|
|
}
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
void DebuggerRunControl::debuggingFinished()
|
2010-06-15 11:42:49 +02:00
|
|
|
{
|
2010-09-14 08:34:07 +02:00
|
|
|
d->m_running = false;
|
2010-06-16 11:08:54 +02:00
|
|
|
emit finished();
|
2010-06-15 11:42:49 +02:00
|
|
|
}
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
bool DebuggerRunControl::isRunning() const
|
2010-06-15 11:42:49 +02:00
|
|
|
{
|
2010-09-14 08:34:07 +02:00
|
|
|
return d->m_running;
|
2010-06-15 11:42:49 +02:00
|
|
|
}
|
|
|
|
|
2010-09-13 13:30:35 +02:00
|
|
|
DebuggerEngine *DebuggerRunControl::engine()
|
2010-06-15 11:42:49 +02:00
|
|
|
{
|
2011-07-29 12:00:11 +02:00
|
|
|
QTC_CHECK(d->m_engine);
|
2010-09-14 08:34:07 +02:00
|
|
|
return d->m_engine;
|
2010-06-15 11:42:49 +02:00
|
|
|
}
|
|
|
|
|
2010-09-14 08:34:07 +02:00
|
|
|
RunConfiguration *DebuggerRunControl::runConfiguration() const
|
|
|
|
{
|
|
|
|
return d->m_myRunConfiguration.data();
|
|
|
|
}
|
2010-11-10 11:39:01 +01:00
|
|
|
|
2010-12-15 09:17:31 +01:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// DebuggerRunControlFactory
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-06-27 22:19:20 +02:00
|
|
|
DebuggerRunControlFactory::DebuggerRunControlFactory(QObject *parent)
|
|
|
|
: IRunControlFactory(parent)
|
2010-12-15 09:17:31 +01:00
|
|
|
{}
|
|
|
|
|
2012-01-10 19:17:24 +01:00
|
|
|
bool DebuggerRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const
|
2010-12-15 09:17:31 +01:00
|
|
|
{
|
2012-01-10 19:17:24 +01:00
|
|
|
return (mode == DebugRunMode || mode == DebugRunModeWithBreakOnMain)
|
2010-12-15 09:17:31 +01:00
|
|
|
&& qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
|
|
|
}
|
|
|
|
|
|
|
|
QString DebuggerRunControlFactory::displayName() const
|
|
|
|
{
|
2012-04-24 09:00:05 +02:00
|
|
|
return DebuggerPlugin::tr("Debug");
|
2010-12-15 09:17:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static DebuggerStartParameters localStartParameters(RunConfiguration *runConfiguration)
|
|
|
|
{
|
|
|
|
DebuggerStartParameters sp;
|
|
|
|
QTC_ASSERT(runConfiguration, return sp);
|
|
|
|
LocalApplicationRunConfiguration *rc =
|
|
|
|
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
|
|
|
QTC_ASSERT(rc, return sp);
|
|
|
|
|
2012-06-28 10:00:04 +02:00
|
|
|
Target *target = runConfiguration->target();
|
|
|
|
Profile *profile = target ? target->profile() : ProfileManager::instance()->defaultProfile();
|
2012-08-15 15:42:53 +02:00
|
|
|
fillParameters(&sp, profile);
|
2010-12-15 09:17:31 +01:00
|
|
|
sp.environment = rc->environment();
|
|
|
|
sp.workingDirectory = rc->workingDirectory();
|
2011-04-19 11:07:34 +02:00
|
|
|
|
|
|
|
#if defined(Q_OS_WIN)
|
|
|
|
// Work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch' ...)
|
2012-08-09 03:58:37 +02:00
|
|
|
sp.workingDirectory = normalizePathName(sp.workingDirectory);
|
2011-04-19 11:07:34 +02:00
|
|
|
#endif
|
|
|
|
|
2010-12-15 09:17:31 +01:00
|
|
|
sp.executable = rc->executable();
|
2011-12-20 17:03:10 +01:00
|
|
|
if (sp.executable.isEmpty())
|
|
|
|
return sp;
|
|
|
|
sp.startMode = StartInternal;
|
2010-12-15 09:17:31 +01:00
|
|
|
sp.processArgs = rc->commandLineArguments();
|
|
|
|
sp.useTerminal = rc->runMode() == LocalApplicationRunConfiguration::Console;
|
|
|
|
sp.dumperLibrary = rc->dumperLibrary();
|
|
|
|
sp.dumperLibraryLocations = rc->dumperLibraryLocations();
|
|
|
|
|
2012-06-28 10:00:04 +02:00
|
|
|
if (target) {
|
|
|
|
if (const Project *project = target->project()) {
|
2011-04-26 09:46:05 +02:00
|
|
|
sp.projectSourceDirectory = project->projectDirectory();
|
2012-06-28 10:00:04 +02:00
|
|
|
if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration())
|
2011-04-26 09:46:05 +02:00
|
|
|
sp.projectBuildDirectory = buildConfig->buildDirectory();
|
|
|
|
sp.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
|
2011-02-25 16:03:22 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-28 09:37:02 +02:00
|
|
|
DebuggerRunConfigurationAspect *aspect = runConfiguration->debuggerAspect();
|
|
|
|
sp.multiProcess = aspect->useMultiProcess();
|
|
|
|
|
|
|
|
if (aspect->useCppDebugger())
|
2012-02-01 09:03:05 +01:00
|
|
|
sp.languages |= CppLanguage;
|
|
|
|
|
2012-03-28 09:37:02 +02:00
|
|
|
if (aspect->useQmlDebugger()) {
|
2011-02-22 13:23:16 +01:00
|
|
|
sp.qmlServerAddress = _("127.0.0.1");
|
2012-03-28 09:37:02 +02:00
|
|
|
sp.qmlServerPort = aspect->qmlDebugServerPort();
|
2012-02-01 09:03:05 +01:00
|
|
|
sp.languages |= QmlLanguage;
|
2010-12-15 09:17:31 +01:00
|
|
|
|
2011-02-07 10:55:22 +01:00
|
|
|
// Makes sure that all bindings go through the JavaScript engine, so that
|
|
|
|
// breakpoints are actually hit!
|
2011-02-25 16:03:22 +01:00
|
|
|
const QString optimizerKey = _("QML_DISABLE_OPTIMIZER");
|
2012-08-09 03:58:37 +02:00
|
|
|
if (!sp.environment.hasKey(optimizerKey))
|
2011-02-25 16:03:22 +01:00
|
|
|
sp.environment.set(optimizerKey, _("1"));
|
2011-02-07 10:55:22 +01:00
|
|
|
|
2012-08-09 03:58:37 +02:00
|
|
|
QtcProcess::addArg(&sp.processArgs, QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(sp.qmlServerPort));
|
2010-12-15 09:17:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// FIXME: If it's not yet build this will be empty and not filled
|
|
|
|
// when rebuild as the runConfiguration is not stored and therefore
|
|
|
|
// cannot be used to retrieve the dumper location.
|
|
|
|
//qDebug() << "DUMPER: " << sp.dumperLibrary << sp.dumperLibraryLocations;
|
|
|
|
sp.displayName = rc->displayName();
|
|
|
|
|
|
|
|
return sp;
|
|
|
|
}
|
|
|
|
|
|
|
|
RunControl *DebuggerRunControlFactory::create
|
2012-01-10 19:17:24 +01:00
|
|
|
(RunConfiguration *runConfiguration, RunMode mode)
|
2010-12-15 09:17:31 +01:00
|
|
|
{
|
2012-01-10 19:17:24 +01:00
|
|
|
QTC_ASSERT(mode == DebugRunMode || mode == DebugRunModeWithBreakOnMain, return 0);
|
2010-12-15 09:17:31 +01:00
|
|
|
DebuggerStartParameters sp = localStartParameters(runConfiguration);
|
2011-12-20 17:03:10 +01:00
|
|
|
if (sp.startMode == NoStartMode)
|
|
|
|
return 0;
|
2012-01-10 19:17:24 +01:00
|
|
|
if (mode == DebugRunModeWithBreakOnMain)
|
2011-05-02 18:22:32 +02:00
|
|
|
sp.breakOnMain = true;
|
2012-08-15 13:21:37 +02:00
|
|
|
|
|
|
|
return doCreate(sp, runConfiguration);
|
2010-12-15 09:17:31 +01:00
|
|
|
}
|
|
|
|
|
2012-08-15 13:21:37 +02:00
|
|
|
static DebuggerEngineType guessUnixCppEngineType(const DebuggerStartParameters &sp)
|
2010-12-15 09:17:31 +01:00
|
|
|
{
|
2012-08-15 13:21:37 +02:00
|
|
|
if (sp.debuggerCommand.contains(QLatin1String("lldb")))
|
|
|
|
return LldbEngineType;
|
|
|
|
return GdbEngineType;
|
2010-12-15 09:17:31 +01:00
|
|
|
}
|
|
|
|
|
2012-08-15 13:21:37 +02:00
|
|
|
static DebuggerEngineType guessCppEngineTypeForAbi(const DebuggerStartParameters &sp, const Abi &abi)
|
2010-12-15 09:17:31 +01:00
|
|
|
{
|
2012-08-15 13:21:37 +02:00
|
|
|
switch (abi.binaryFormat()) {
|
|
|
|
case Abi::ElfFormat:
|
|
|
|
case Abi::MachOFormat:
|
|
|
|
return guessUnixCppEngineType(sp) ;
|
|
|
|
case Abi::PEFormat:
|
|
|
|
if (abi.osFlavor() == Abi::WindowsMSysFlavor)
|
|
|
|
return guessUnixCppEngineType(sp);
|
|
|
|
return CdbEngineType;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NoEngineType;
|
|
|
|
}
|
2010-12-15 09:34:02 +01:00
|
|
|
|
2012-08-23 15:23:37 +02:00
|
|
|
static DebuggerEngineType guessCppEngineType(const DebuggerStartParameters &sp)
|
2012-08-15 13:21:37 +02:00
|
|
|
{
|
2012-08-23 15:23:37 +02:00
|
|
|
if (sp.toolChainAbi.isValid()) {
|
|
|
|
const DebuggerEngineType et = guessCppEngineTypeForAbi(sp, sp.toolChainAbi);
|
|
|
|
if (et != NoEngineType)
|
|
|
|
return et;
|
2012-08-15 13:21:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
// If a file has PDB files, it has been compiled by VS.
|
|
|
|
if (sp.executable.endsWith(_(".exe"), Qt::CaseInsensitive)) {
|
|
|
|
QStringList pdbFiles;
|
|
|
|
QString errorMessage;
|
|
|
|
if (getPDBFiles(sp.executable, &pdbFiles, &errorMessage) && !pdbFiles.isEmpty())
|
|
|
|
return CdbEngineType;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
QList<Abi> abis = Abi::abisOfBinary(FileName::fromString(sp.executable));
|
|
|
|
foreach (const Abi &abi, abis) {
|
|
|
|
DebuggerEngineType et = guessCppEngineTypeForAbi(sp, abi);
|
|
|
|
if (et != NoEngineType)
|
|
|
|
return et;
|
|
|
|
}
|
|
|
|
|
|
|
|
return guessUnixCppEngineType(sp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void fixupEngineTypes(DebuggerStartParameters &sp, RunConfiguration *rc)
|
|
|
|
{
|
|
|
|
if (sp.masterEngineType != NoEngineType)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (sp.executable.endsWith(_(".js"))) {
|
|
|
|
sp.masterEngineType = ScriptEngineType;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sp.executable.endsWith(_(".py"))) {
|
|
|
|
sp.masterEngineType = PdbEngineType;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rc) {
|
|
|
|
DebuggerRunConfigurationAspect *aspect = rc->debuggerAspect();
|
2012-08-23 15:23:37 +02:00
|
|
|
if (const Target *target = rc->target())
|
|
|
|
fillParameters(&sp, target->profile());
|
|
|
|
const bool useCppDebugger = aspect->useCppDebugger();
|
|
|
|
const bool useQmlDebugger = aspect->useQmlDebugger();
|
2012-08-15 13:21:37 +02:00
|
|
|
if (useQmlDebugger) {
|
|
|
|
if (useCppDebugger) {
|
|
|
|
sp.masterEngineType = QmlCppEngineType;
|
2012-08-23 15:23:37 +02:00
|
|
|
sp.firstSlaveEngineType = guessCppEngineType(sp);
|
2012-08-15 13:21:37 +02:00
|
|
|
sp.secondSlaveEngineType = QmlCppEngineType;
|
|
|
|
} else {
|
|
|
|
sp.masterEngineType = QmlEngineType;
|
|
|
|
}
|
|
|
|
} else {
|
2012-08-23 15:23:37 +02:00
|
|
|
sp.masterEngineType = guessCppEngineType(sp);
|
2012-08-15 13:21:37 +02:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2012-08-23 15:23:37 +02:00
|
|
|
sp.masterEngineType = guessCppEngineType(sp);
|
2012-08-15 13:21:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DebuggerRunControl *DebuggerRunControlFactory::doCreate
|
|
|
|
(const DebuggerStartParameters &sp0, RunConfiguration *rc)
|
|
|
|
{
|
|
|
|
DebuggerStartParameters sp = sp0;
|
|
|
|
if (!debuggerCore()->boolSetting(AutoEnrichParameters)) {
|
|
|
|
const QString sysroot = sp.sysRoot;
|
|
|
|
if (sp.debugInfoLocation.isEmpty()) {
|
|
|
|
sp.debugInfoLocation = sysroot + QLatin1String("/usr/lib/debug");
|
|
|
|
}
|
|
|
|
if (sp.debugSourceLocation.isEmpty()) {
|
|
|
|
QString base = sysroot + QLatin1String("/usr/src/debug/");
|
|
|
|
sp.debugSourceLocation.append(base + QLatin1String("qt5base/src/corelib"));
|
|
|
|
sp.debugSourceLocation.append(base + QLatin1String("qt5base/src/gui"));
|
|
|
|
sp.debugSourceLocation.append(base + QLatin1String("qt5base/src/network"));
|
|
|
|
sp.debugSourceLocation.append(base + QLatin1String("qt5base/src/v8"));
|
|
|
|
sp.debugSourceLocation.append(base + QLatin1String("qt5declarative/src/qml"));
|
|
|
|
}
|
2010-12-15 09:34:02 +01:00
|
|
|
}
|
|
|
|
|
2012-08-15 13:21:37 +02:00
|
|
|
fixupEngineTypes(sp, rc);
|
|
|
|
if (!sp.masterEngineType)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return new DebuggerRunControl(rc, sp);
|
|
|
|
}
|
|
|
|
|
|
|
|
DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun
|
|
|
|
(const DebuggerStartParameters &sp, RunConfiguration *runConfiguration)
|
|
|
|
{
|
|
|
|
DebuggerRunControl *rc = doCreate(sp, runConfiguration);
|
|
|
|
if (!rc)
|
|
|
|
return 0;
|
|
|
|
debuggerCore()->showMessage(sp.startMessage, 0);
|
|
|
|
ProjectExplorerPlugin::instance()->startRunControl(rc, DebugRunMode);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
RunConfigWidget *DebuggerRunControlFactory::createConfigurationWidget
|
|
|
|
(RunConfiguration *runConfiguration)
|
|
|
|
{
|
|
|
|
return new DebuggerRunConfigWidget(runConfiguration);
|
2011-02-24 16:50:15 +01:00
|
|
|
}
|
|
|
|
|
2012-08-15 14:33:39 +02:00
|
|
|
DebuggerEngine *DebuggerRunControlFactory::createEngine(DebuggerEngineType et,
|
|
|
|
const DebuggerStartParameters &sp, QString *errorMessage)
|
2011-02-24 16:50:15 +01:00
|
|
|
{
|
|
|
|
switch (et) {
|
|
|
|
case GdbEngineType:
|
2012-08-15 14:33:39 +02:00
|
|
|
return createGdbEngine(sp);
|
2011-02-24 16:50:15 +01:00
|
|
|
case ScriptEngineType:
|
|
|
|
return createScriptEngine(sp);
|
|
|
|
case CdbEngineType:
|
2012-08-15 14:33:39 +02:00
|
|
|
return createCdbEngine(sp, errorMessage);
|
2011-02-24 16:50:15 +01:00
|
|
|
case PdbEngineType:
|
|
|
|
return createPdbEngine(sp);
|
|
|
|
case QmlEngineType:
|
2012-08-15 14:33:39 +02:00
|
|
|
return createQmlEngine(sp);
|
2011-02-24 16:50:15 +01:00
|
|
|
case LldbEngineType:
|
|
|
|
return createLldbEngine(sp);
|
2012-08-15 13:21:37 +02:00
|
|
|
case QmlCppEngineType:
|
|
|
|
return createQmlCppEngine(sp, errorMessage);
|
2011-04-08 16:04:53 +02:00
|
|
|
default:
|
|
|
|
break;
|
2011-02-24 16:50:15 +01:00
|
|
|
}
|
2012-04-24 09:00:05 +02:00
|
|
|
*errorMessage = DebuggerPlugin::tr("Unable to create a debugger engine of the type '%1'").
|
2011-02-24 16:50:15 +01:00
|
|
|
arg(_(engineTypeName(et)));
|
2010-12-15 09:17:31 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-09-11 08:55:16 +02:00
|
|
|
} // namespace Debugger
|
2012-02-17 19:05:11 +01:00
|
|
|
|
|
|
|
#include "debuggerrunner.moc"
|